Fix T53017: Cycles not detecting AMD GPU when there is an NVidia GPU too.
authorMathieu Menuet <bliblubli>
Sun, 8 Oct 2017 16:20:55 +0000 (18:20 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Sun, 8 Oct 2017 16:36:02 +0000 (18:36 +0200)
Best guess is that cuInit() somehow interferes with the AMD graphics driver
on Windows, and switching the initialization order to do OpenCL first seems
to solve the issue.

intern/cycles/device/device.cpp

index 533294407ea3e315e7dc382d50731dbffc8e342f..e5a1aa610b6498b415a0d34e030689d1ed31d49d 100644 (file)
@@ -324,16 +324,17 @@ vector<DeviceInfo>& Device::available_devices()
 {
        if(need_devices_update) {
                devices.clear();
-#ifdef WITH_CUDA
-               if(device_cuda_init())
-                       device_cuda_info(devices);
-#endif
 
 #ifdef WITH_OPENCL
                if(device_opencl_init())
                        device_opencl_info(devices);
 #endif
 
+#ifdef WITH_CUDA
+               if(device_cuda_init())
+                       device_cuda_info(devices);
+#endif
+
                device_cpu_info(devices);
 
 #ifdef WITH_NETWORK
@@ -350,12 +351,6 @@ string Device::device_capabilities()
 {
        string capabilities = "CPU device capabilities: ";
        capabilities += device_cpu_capabilities() + "\n";
-#ifdef WITH_CUDA
-       if(device_cuda_init()) {
-               capabilities += "\nCUDA device capabilities:\n";
-               capabilities += device_cuda_capabilities();
-       }
-#endif
 
 #ifdef WITH_OPENCL
        if(device_opencl_init()) {
@@ -364,6 +359,13 @@ string Device::device_capabilities()
        }
 #endif
 
+#ifdef WITH_CUDA
+       if(device_cuda_init()) {
+               capabilities += "\nCUDA device capabilities:\n";
+               capabilities += device_cuda_capabilities();
+       }
+#endif
+
        return capabilities;
 }