cudaGetDeviceCount() returns 38 as error code on Win10 while 2 GPUs are present and working

On a Windows 10 box, with Cuda 8.0.61 installed, cudaGetDeviceCount() returns 0 with the error code 38 (cudaErrorNoDevice).

Below, the raw output obtained by running “nvidia-smi.exe -a”.

I am bit baffled by the error, because the two GPUs are working fine, but they just aren’t seen by Cuda.

Does anyone know how I could fix the problem?

Thanks!
Joannes

==============NVSMI LOG==============

Timestamp : Fri Jun 30 12:12:53 2017
Driver Version : 382.05

Attached GPUs : 2
GPU 0000:01:00.0
Product Name : GeForce GTX 960M
Product Brand : GeForce
Display Mode : Disabled
Display Active : Disabled
Persistence Mode : N/A
Accounting Mode : Disabled
Accounting Mode Buffer Size : 1920
Driver Model
Current : WDDM
Pending : WDDM
Serial Number : N/A
GPU UUID : GPU-xxx
Minor Number : N/A
VBIOS Version : 82.07.82.00.22
MultiGPU Board : No
Board ID : 0x100
GPU Part Number : N/A
Inforom Version
Image Version : N/A
OEM Object : N/A
ECC Object : N/A
Power Management Object : N/A
GPU Operation Mode
Current : N/A
Pending : N/A
GPU Virtualization Mode
Virtualization mode : None
PCI
Bus : 0x01
Device : 0x00
Domain : 0x0000
Device Id : 0x139B10DE
Bus Id : 0000:01:00.0
Sub System Id : 0x06E41028
GPU Link Info
PCIe Generation
Max : 2
Current : 1
Link Width
Max : 16x
Current : 16x
Bridge Chip
Type : N/A
Firmware : N/A
Replays since reset : 0
Tx Throughput : 0 KB/s
Rx Throughput : 0 KB/s
Fan Speed : N/A
Performance State : P8
Clocks Throttle Reasons
Idle : Not Active
Applications Clocks Setting : Not Active
SW Power Cap : Not Active
HW Slowdown : Not Active
Sync Boost : Not Active
Unknown : Not Active
FB Memory Usage
Total : 2048 MiB
Used : 28 MiB
Free : 2020 MiB
BAR1 Memory Usage
Total : 256 MiB
Used : 225 MiB
Free : 31 MiB
Compute Mode : Default
Utilization
Gpu : 0 %
Memory : 0 %
Encoder : 0 %
Decoder : 0 %
Ecc Mode
Current : N/A
Pending : N/A
ECC Errors
Volatile
Single Bit
Device Memory : N/A
Register File : N/A
L1 Cache : N/A
L2 Cache : N/A
Texture Memory : N/A
Texture Shared : N/A
Total : N/A
Double Bit
Device Memory : N/A
Register File : N/A
L1 Cache : N/A
L2 Cache : N/A
Texture Memory : N/A
Texture Shared : N/A
Total : N/A
Aggregate
Single Bit
Device Memory : N/A
Register File : N/A
L1 Cache : N/A
L2 Cache : N/A
Texture Memory : N/A
Texture Shared : N/A
Total : N/A
Double Bit
Device Memory : N/A
Register File : N/A
L1 Cache : N/A
L2 Cache : N/A
Texture Memory : N/A
Texture Shared : N/A
Total : N/A
Retired Pages
Single Bit ECC : N/A
Double Bit ECC : N/A
Pending : N/A
Temperature
GPU Current Temp : 50 C
GPU Shutdown Temp : 101 C
GPU Slowdown Temp : 96 C
Power Readings
Power Management : N/A
Power Draw : N/A
Power Limit : N/A
Default Power Limit : N/A
Enforced Power Limit : N/A
Min Power Limit : N/A
Max Power Limit : N/A
Clocks
Graphics : 405 MHz
SM : 405 MHz
Memory : 405 MHz
Video : 405 MHz
Applications Clocks
Graphics : 1032 MHz
Memory : 2505 MHz
Default Applications Clocks
Graphics : 1032 MHz
Memory : 2505 MHz
Max Clocks
Graphics : 1202 MHz
SM : 1202 MHz
Memory : 2505 MHz
Video : 1081 MHz
Clock Policy
Auto Boost : N/A
Auto Boost Default : N/A
Processes : None

GPU 0000:0B:00.0
Product Name : GeForce GTX 1080 Ti
Product Brand : GeForce
Display Mode : Enabled
Display Active : Enabled
Persistence Mode : N/A
Accounting Mode : Disabled
Accounting Mode Buffer Size : 1920
Driver Model
Current : WDDM
Pending : WDDM
Serial Number : xxx
GPU UUID : GPU-xxx
Minor Number : N/A
VBIOS Version : 86.02.39.00.01
MultiGPU Board : No
Board ID : 0xb00
GPU Part Number : 900-1G611-0050-000
Inforom Version
Image Version : G001.0000.01.04
OEM Object : 1.1
ECC Object : N/A
Power Management Object : N/A
GPU Operation Mode
Current : N/A
Pending : N/A
GPU Virtualization Mode
Virtualization mode : None
PCI
Bus : 0x0B
Device : 0x00
Domain : 0x0000
Device Id : 0x1B0610DE
Bus Id : 0000:0B:00.0
Sub System Id : 0x85E21043
GPU Link Info
PCIe Generation
Max : 3
Current : 2
Link Width
Max : 16x
Current : 4x
Bridge Chip
Type : N/A
Firmware : N/A
Replays since reset : 0
Tx Throughput : 11000 KB/s
Rx Throughput : 21000 KB/s
Fan Speed : 23 %
Performance State : P5
Clocks Throttle Reasons
Idle : Not Active
Applications Clocks Setting : Not Active
SW Power Cap : Not Active
HW Slowdown : Not Active
Sync Boost : Not Active
Unknown : Not Active
FB Memory Usage
Total : 11264 MiB
Used : 283 MiB
Free : 10981 MiB
BAR1 Memory Usage
Total : 256 MiB
Used : 229 MiB
Free : 27 MiB
Compute Mode : Default
Utilization
Gpu : 22 %
Memory : 9 %
Encoder : 0 %
Decoder : 0 %
Ecc Mode
Current : N/A
Pending : N/A
ECC Errors
Volatile
Single Bit
Device Memory : N/A
Register File : N/A
L1 Cache : N/A
L2 Cache : N/A
Texture Memory : N/A
Texture Shared : N/A
Total : N/A
Double Bit
Device Memory : N/A
Register File : N/A
L1 Cache : N/A
L2 Cache : N/A
Texture Memory : N/A
Texture Shared : N/A
Total : N/A
Aggregate
Single Bit
Device Memory : N/A
Register File : N/A
L1 Cache : N/A
L2 Cache : N/A
Texture Memory : N/A
Texture Shared : N/A
Total : N/A
Double Bit
Device Memory : N/A
Register File : N/A
L1 Cache : N/A
L2 Cache : N/A
Texture Memory : N/A
Texture Shared : N/A
Total : N/A
Retired Pages
Single Bit ECC : N/A
Double Bit ECC : N/A
Pending : N/A
Temperature
GPU Current Temp : 32 C
GPU Shutdown Temp : 96 C
GPU Slowdown Temp : 93 C
Power Readings
Power Management : Supported
Power Draw : 19.17 W
Power Limit : 250.00 W
Default Power Limit : 250.00 W
Enforced Power Limit : 250.00 W
Min Power Limit : 125.00 W
Max Power Limit : 300.00 W
Clocks
Graphics : 670 MHz
SM : 670 MHz
Memory : 810 MHz
Video : 734 MHz
Applications Clocks
Graphics : N/A
Memory : N/A
Default Applications Clocks
Graphics : N/A
Memory : N/A
Max Clocks
Graphics : 1911 MHz
SM : 1911 MHz
Memory : 5505 MHz
Video : 1708 MHz
Clock Policy
Auto Boost : N/A
Auto Boost Default : N/A
Processes
Process ID : 2216
Type : C+G
Name : Insufficient Permissions
Used GPU Memory : Not available in WDDM driver model
Process ID : 8128
Type : C+G
Name : C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe
Used GPU Memory : Not available in WDDM driver model

Actually, the display driver that is shipped with CUDA 8.0.61 is out-of-date and causes a crash on my machine. How can I have CUDA adjusted for the latest 384.xx version of the driver? Thanks

Update: my second GPU is connected through a ThunderBolt port (using a Razer Core). By unplugging the Razer Core, Cuda suddenly starts working again (no reboot even required). I am further baffled by this behavior. Seemingly, Cuda can only “see” the devices if no eGPU is plugged in.

Can someone help me to get Cuda working in an eGPU setup on Windows? Thanks

Maybe you should ask Razer Core about it.