[CMake] CMake CUDA 3.8+/9 support as a first class language with out Visual Studio Support... err what?

Brian J. Davis bitminer at gmail.com
Sun Jul 30 16:32:24 EDT 2017


Things I have tried:

Install Visual Studio 15
Install CUDA 8.0 + patch
Install Visual Studio 13 <- Yes Nvidia / CMake'ers sometimes we have to 
do back ports
Install CUDA 7.5
VS 13 will run CUDA 8.0 samples nbody/deviceQuery
VS 13 does not run CUDA 7.5  samples nbody or any example attempting to 
actually use the GPU.  deviceQuery worked.
CMake v3.2/3.9 compiles with either FindCUDA approach v3.2 or new 
"project" approach v3.9, but neither is able to access the deivce. 
Devcie query code such as in deviceQuery works stating there is a CUDA 
cable device ready and waiting but fails on device access like 
cudaMalloc calls.
Reinstalled CUDA 7.5
Still only VS with 8.0 works with samples.
Used NVIDIA Control panel to assign every program to run on NVIDIA GPU 
such as VS and CMake instead of Integrated graphics through Nvidia 
Optimus Interface.
Used GeForce Experience to get latest driver.
VS, CUDA, CMake is at same state.
Removed all CUDA 8.0 goop
Forced to reinstall/repair VS 13 due to .NET not sure why this happened.
VS unable to run nbody in VS 13 CUDA 7.5
Reinstall CUDA 7.5
Same state
Reinstall CUDA 8.0
VS 13 works with CUDA 8.0 but still  will not run nbody with 7.5 will 
run deviceQuery and report happily there a a CUDA device just beckoning 
to be used.
Removed CUDA 8.0
Removed CUDA 7.5
Removed GeForce Experience to keep it from mucking about in the 
background with what ever driver version shenanigans it may be performing.
Device Manager -> NVIDIA GeForce GTX 960M -> Uninstall device.
Device keeps cumming back across reboots as it appears, may be due to 
NVIDIA Graphics Driver 353.90 in "Add remove programs"
Reinstalled CUDA 7.5
VS 13 runs successfully deviceQuery and nbody with 7.5.  Oddly 
deviceQuery reports driver version at 9.0 ???  Not sure how that's 
possible.  My understanding/experience has been Driver version / Runtime 
match after install say like 7.5 / 7.5, but hey this has gone completely 
off the rails.

C:\ProgramData\NVIDIA Corporation\CUDA 
Samples\v7.5\bin\win64\Debug>deviceQuery.exe
deviceQuery.exe Starting...

  CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: "GeForce GTX 960M"
   CUDA Driver Version / Runtime Version          9.0 / 7.5
   CUDA Capability Major/Minor version number:    5.0
   Total amount of global memory:                 4096 MBytes 
(4294967296 bytes)
   ( 5) Multiprocessors, (128) CUDA Cores/MP:     640 CUDA Cores
   GPU Max Clock rate:                            1176 MHz (1.18 GHz)
   Memory Clock rate:                             2505 Mhz
   Memory Bus Width:                              128-bit
   L2 Cache Size:                                 2097152 bytes
   Maximum Texture Dimension Size (x,y,z)         1D=(65536), 2D=(65536, 
65536), 3D=(4096, 4096, 4096)
   Maximum Layered 1D Texture Size, (num) layers  1D=(16384), 2048 layers
   Maximum Layered 2D Texture Size, (num) layers  2D=(16384, 16384), 
2048 layers
   Total amount of constant memory:               65536 bytes
   Total amount of shared memory per block:       49152 bytes
   Total number of registers available per block: 65536
   Warp size:                                     32
   Maximum number of threads per multiprocessor:  2048
   Maximum number of threads per block:           1024
   Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
   Max dimension size of a grid size    (x,y,z): (2147483647, 65535, 65535)
   Maximum memory pitch:                          2147483647 bytes
   Texture alignment:                             512 bytes
   Concurrent copy and kernel execution:          Yes with 1 copy engine(s)
   Run time limit on kernels:                     Yes
   Integrated GPU sharing Host Memory:            No
   Support host page-locked memory mapping:       Yes
   Alignment requirement for Surfaces:            Yes
   Device has ECC support:                        Disabled
   CUDA Device Driver Mode (TCC or WDDM):         WDDM (Windows Display 
Driver Model)
   Device supports Unified Addressing (UVA):      Yes
   Device PCI Domain ID / Bus ID / location ID:   0 / 2 / 0
   Compute Mode:
      < Default (multiple host threads can use ::cudaSetDevice() with 
device simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 9.0, CUDA 
Runtime Version = 7.5, NumDevs = 1, Device0 = GeForce GTX 960M


Device Manager -> NVIDIA GeForce GTX 960M -> Properties reports:
NVidia GeForce GTX 960M
Driver provider: NVIDIA
Driver Date:  7/18/2017
Driver Version: 22.21.13.8494
Digital Signer: Microsoft Windows Hardware Compatibility Publisher

Note: Driver Date:  7/18/2017

Could this mean there is a 9.0 driver in the wild that I cannot download 
from NVIDIA or through GeForce Experience, but may be delivered via OS?  
Posted @ https://devtalk.nvidia.com/default/board/58/ to see if anyone 
knows what is going on here.

CMake 3.2/3.9 still fail to run (again compiles fine)

What It appears I am experiencing is some CUDA 7.5 / 8.0 driver version 
conflicts where 7.5 does not seem to play nice with 8.0 drivers, but 
*might* be working with 9.0 driver... I say might as I am not sure what 
is going on there.

I have some bad news for NVIDIA their driver "API Backward/Not Forward 
Compatible" diagram may have been accurate from 1.0 to 2.0, but 7.5 8.0 
is shaping up to need a whole new diagram of broken links and end around 
curvy arrows.

file:///C:/Program%20Files/NVIDIA%20GPU%20Computing%20Toolkit/CUDA/v7.5/doc/html/common/graphics/compatibility-of-cuda-versions.png

CMake is still a dysfunctional hot mess.  It does not work in any 
scenario.  That's not to say I can't get it to work as I have on a Dell 
M4700 with a Quadro and 7.5 with CMake 3.2 and VS12/13. Thought I would 
try upgrade to 3.9 on new laptop, but hey I can't seem to get any 
version to work on the new laptop and I can only get Samples in 7.5 to 
work if I seemingly uninstall all CUDA 8.0 related bits, most notable of 
which appears/seems to be the driver.

Next I am going to remove all NVIDA drivers and try reinstall of CUDA 
7.5  see if I can get deviceQuery to report 7.5/7.5.   Also looking into 
a mooc course on weaving to make something useful out of this pile of 
hair I have pulled out.

Thoughts on how to get CMake to work at all in any scenario.





More information about the CMake mailing list