[Bf-blender-cvs] [b4bddf2e3bd] tmp-2.83-cycles-rtx3-kernels: Fix OptiX being shown as available on first generation Maxwell GPUs
Patrick Mours
noreply at git.blender.org
Mon Feb 8 14:00:19 CET 2021
Commit: b4bddf2e3bd3e33a9ca7488fc78112f8a5fa0544
Author: Patrick Mours
Date: Fri Jul 24 15:36:09 2020 +0200
Branches: tmp-2.83-cycles-rtx3-kernels
https://developer.blender.org/rBb4bddf2e3bd3e33a9ca7488fc78112f8a5fa0544
Fix OptiX being shown as available on first generation Maxwell GPUs
The OptiX kernels are compiled for target "compute_sm_52", which is only available on second
generation Maxwell GPUs, so disable support for older ones.
===================================================================
M intern/cycles/device/device_optix.cpp
===================================================================
diff --git a/intern/cycles/device/device_optix.cpp b/intern/cycles/device/device_optix.cpp
index db04c13d083..2b28d1e1dbb 100644
--- a/intern/cycles/device/device_optix.cpp
+++ b/intern/cycles/device/device_optix.cpp
@@ -1543,10 +1543,11 @@ void device_optix_info(const vector<DeviceInfo> &cuda_devices, vector<DeviceInfo
for (DeviceInfo info : cuda_devices) {
assert(info.type == DEVICE_CUDA);
- int major;
+ int major, minor;
cuDeviceGetAttribute(&major, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, info.num);
- if (major < 5) {
- continue; // Only Maxwell and up are supported by OptiX
+ cuDeviceGetAttribute(&minor, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, info.num);
+ if (major < 5 || (major == 5 && minor < 2)) {
+ continue; // Only Maxwell 2.0 and up are supported by OptiX
}
info.type = DEVICE_OPTIX;
More information about the Bf-blender-cvs
mailing list