I made some mistakes while trying to add a fan cooling system to my Tesla P40 GPU and I now can share the ideal way to do it.
I purchased a Tesla P40 with a fan cooling system online (you can find these on aliexpress/taobao) and found that it is too wide and blocks PCIe slots that I want to use (without risers). I had read that the 980 Ti cooling system can be used on the Tesla P40 and I could see that it would fit much better since I already have a GTX 980 Ti.
I decided to purchase a broken GTX 980 Ti that is exactly like the one that I have so that I can use the cooling system without sacrificing my fully functional 980 Ti GPU.
After I received the broken GPU and disassembled it I realized that this project would not be as simple as I had hoped. Even though I already had a 980 Ti to reference, I did not notice that the change to the connector position would interfere with the heat sink. I also learned that a lot of components on the board were in different positions.
I decided to use an oscillating saw to cut the components and make it fit. This was pretty tedious but in the end it does seem to work well. In the above image the P40 in on the top and the 980 Ti is on the bottom.
I also marked the 4 pin connector above that was added by the vendor to power the fan. This is not standard on Tesla GPUs so note you will need to buy an adapter if you do this yourself.
Here are the final cuts that I made to the heat plate:
The next issue was that the heat sink was not designed around the P40 connector. This can easily be cut but it is dangerously close to a heat pipe that must not be damaged. It was also hard to tell if the heat pipe will have enough clearance for the connector (it didn't).
I was successful in making the cuts without puncturing the heat pipe but was disappointed to see that the connector does make contact with the heat pipe. It ultimately does fit well enough and is only slightly bent compared to an original 980 Ti.
You can see here that the metal plate still has a gap so that it is not touching the components on the board that are taller than the 980 Ti components. This also shows the slight bending caused by the heat pipe issue. The Tesla P40 is on top and the 980 Ti is on the bottom.
I was able to install the modified GPU and it works great so far. The Tesla P40 does not have the light on because it did not use that connector but it fits and only blocks 1 PCIe slot now.
The extra space has allowed me to add a x16 adapter for 4 NVMe SSDs and still leaves a x8 slot available.
In the future I may replace the 980 Ti with another Tesla P40 and then use the x8 slot for a small GPU with HDMI/DP output. I want to keep some display output ports because I use them to pass through to a VM in Proxmox to use as my primary home PC. The Tesla GPU is passed through to a separate Ubuntu Server VM and the SSDs are used by a separate TrueNAS VM.
This is an example of a good cooling system to use for a Tesla GPU (P40, M40 etc.), it is the MSI version of the 980Ti GPU. You can see that there is plenty of clearance for the connector when the position changes and there is no custom fit metal plate that you would need to put so much effort into cutting.
Other GPU models should work also but I think the MSI versions are usually going to be the easiest to use. If you want to do this, just look for a deal on Ebay for a broken GPU since the issue will usually be on the circuit board only.
Read through this thread for an example of how to use this exact MSI 980 Ti cooling system: https://extremehw.net/topic/1228-trying-to-improve-a-tesla-m40/