If you are using the P40 as a shared graphics device for VMWare VMs, it may or may not be usable for CUDA depending on a number of configuration and use parameters.
It would be important to know what you are doing with VMWare virtualization (if anything).
If you are using GRID software for vGPU virtualization/sharing, you should probably ask your question on the GRID forums
I got some support at GTC. For some reason my VDI will not support a driver above the 386.09 that I have installed now. Version 391.29 tells me that it can’t find compatible hardware.
Anything below version 387 will only support CUDA 9.0. CUDA 9.1 requires 387 and above.