diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-06-18 19:30:48 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-06-18 21:05:36 +0300 |
commit | b10921f0ccbd29f7f1fd19b9e9aa103b5a74fd9a (patch) | |
tree | 75445a729d00aa54156f024f857dc1ce3b11734a /intern/cycles/device/device_cuda.cpp | |
parent | 1dab26afb9c8f8e12c3e97a1503f09a4f437e77f (diff) |
Fix Cycles CUDA suboptimal performance on Windows 10 with recent graphics cards
When compute preemption is available we schedule more work which is more
efficient. However the CUDA driver appears to be incorrectly reporting this as
unavailable, even though it should be supported starting with Windows 10 1803
and Pascal and Turing (10x0 and 20x0) graphics cards.
This reduces render time by about a 25% difference on our benchmark scenes. On
Linux compute preemption appears to be reported correctly.
Diffstat (limited to 'intern/cycles/device/device_cuda.cpp')
-rw-r--r-- | intern/cycles/device/device_cuda.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp index cac1edb188e..7ab823423b5 100644 --- a/intern/cycles/device/device_cuda.cpp +++ b/intern/cycles/device/device_cuda.cpp @@ -47,6 +47,7 @@ #include "util/util_system.h" #include "util/util_types.h" #include "util/util_time.h" +#include "util/util_windows.h" #include "kernel/split/kernel_split_data_types.h" @@ -2659,6 +2660,14 @@ void device_cuda_info(vector<DeviceInfo> &devices) cuDeviceGetAttribute(&timeout_attr, CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, num); cuDeviceGetAttribute(&preempt_attr, CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED, num); + /* The CUDA driver reports compute preemption as not being available on + * Windows 10 even when it is, due to an issue in application profiles. + * Detect case where we expect it to be available and override. */ + if (preempt_attr == 0 && (major >= 6) && system_windows_version_at_least(10, 17134)) { + VLOG(1) << "Assuming device has compute preemption on Windows 10."; + preempt_attr = 1; + } + if (timeout_attr && !preempt_attr) { VLOG(1) << "Device is recognized as display."; info.description += " (Display)"; @@ -2666,6 +2675,7 @@ void device_cuda_info(vector<DeviceInfo> &devices) display_devices.push_back(info); } else { + VLOG(1) << "Device has compute preemption or is not used for display."; devices.push_back(info); } VLOG(1) << "Added device \"" << name << "\" with id \"" << info.id << "\"."; |