Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Mours <pmours@nvidia.com>2020-06-05 13:33:00 +0300
committerPatrick Mours <pmours@nvidia.com>2020-06-05 13:33:00 +0300
commit473aaa389cca1a5062a5867b08fb05276d0b385d (patch)
tree26021148728aa35130341e9036d2b759a984086a
parent56da8dae6776a267a014fa3cd56ad447662df407 (diff)
Cycles: Enable OptiX on all Maxwell+ GPUs
-rw-r--r--intern/cycles/device/device_optix.cpp34
1 files changed, 11 insertions, 23 deletions
diff --git a/intern/cycles/device/device_optix.cpp b/intern/cycles/device/device_optix.cpp
index 441fa35f8af..db04c13d083 100644
--- a/intern/cycles/device/device_optix.cpp
+++ b/intern/cycles/device/device_optix.cpp
@@ -1537,34 +1537,22 @@ bool device_optix_init()
void device_optix_info(const vector<DeviceInfo> &cuda_devices, vector<DeviceInfo> &devices)
{
+ devices.reserve(cuda_devices.size());
+
// Simply add all supported CUDA devices as OptiX devices again
- for (const DeviceInfo &cuda_info : cuda_devices) {
- DeviceInfo info = cuda_info;
+ for (DeviceInfo info : cuda_devices) {
assert(info.type == DEVICE_CUDA);
- info.type = DEVICE_OPTIX;
- info.id += "_OptiX";
- // Figure out RTX support
- CUdevice cuda_device = 0;
- CUcontext cuda_context = NULL;
- unsigned int rtcore_version = 0;
- if (cuDeviceGet(&cuda_device, info.num) == CUDA_SUCCESS &&
- cuDevicePrimaryCtxRetain(&cuda_context, cuda_device) == CUDA_SUCCESS) {
- OptixDeviceContext optix_context = NULL;
- if (optixDeviceContextCreate(cuda_context, nullptr, &optix_context) == OPTIX_SUCCESS) {
- optixDeviceContextGetProperty(optix_context,
- OPTIX_DEVICE_PROPERTY_RTCORE_VERSION,
- &rtcore_version,
- sizeof(rtcore_version));
- optixDeviceContextDestroy(optix_context);
- }
- cuDevicePrimaryCtxRelease(cuda_device);
+ int major;
+ cuDeviceGetAttribute(&major, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, info.num);
+ if (major < 5) {
+ continue; // Only Maxwell and up are supported by OptiX
}
- // Only add devices with RTX support
- if (rtcore_version != 0 || getenv("CYCLES_OPTIX_TEST")) {
- devices.push_back(info);
- }
+ info.type = DEVICE_OPTIX;
+ info.id += "_OptiX";
+
+ devices.push_back(info);
}
}