diff options
author | Patrick Mours <pmours@nvidia.com> | 2021-11-09 14:24:54 +0300 |
---|---|---|
committer | Patrick Mours <pmours@nvidia.com> | 2021-11-09 16:47:26 +0300 |
commit | 9daf6a69a6acd95f0b46bc45e5f3ae27d0904764 (patch) | |
tree | 75241b60454114af38e7ed213b0f4c235a50dcbe /intern | |
parent | 65c5ebf5779d07fb92fabd0ff992337f6c980cde (diff) |
Fix T92472: OptiX denoising artifacts with recent GPU driver 495.29.05 or newer on Linux
Adds a workaround for a driver bug in r495 that causes artifacts with OptiX denoising.
`optixDenoiserSetup` is not working properly there when called with a stream other than the
default stream, so use the default stream for now and force synchronization across the entire
context afterwards to ensure the other stream Cycles uses to enqueue the actual denoising
command cannot execute before the denoising setup has finished.
Maniphest Tasks: T92472
Differential Revision: https://developer.blender.org/D13158
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/device/optix/device_impl.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/intern/cycles/device/optix/device_impl.cpp b/intern/cycles/device/optix/device_impl.cpp index 9b9a5ac0de7..7f94212f383 100644 --- a/intern/cycles/device/optix/device_impl.cpp +++ b/intern/cycles/device/optix/device_impl.cpp @@ -891,20 +891,23 @@ bool OptiXDevice::denoise_configure_if_needed(DenoiseContext &context) denoiser_.state.alloc_to_device(denoiser_.scratch_offset + denoiser_.scratch_size); /* Initialize denoiser state for the current tile size. */ - const OptixResult result = optixDenoiserSetup(denoiser_.optix_denoiser, - denoiser_.queue.stream(), - buffer_params.width, - buffer_params.height, - denoiser_.state.device_pointer, - denoiser_.scratch_offset, - denoiser_.state.device_pointer + - denoiser_.scratch_offset, - denoiser_.scratch_size); + const OptixResult result = optixDenoiserSetup( + denoiser_.optix_denoiser, + 0, /* Work around bug in r495 drivers that causes artifacts when denoiser setup is called + on a stream that is not the default stream */ + buffer_params.width, + buffer_params.height, + denoiser_.state.device_pointer, + denoiser_.scratch_offset, + denoiser_.state.device_pointer + denoiser_.scratch_offset, + denoiser_.scratch_size); if (result != OPTIX_SUCCESS) { set_error("Failed to set up OptiX denoiser"); return false; } + cuda_assert(cuCtxSynchronize()); + denoiser_.is_configured = true; denoiser_.configured_size.x = buffer_params.width; denoiser_.configured_size.y = buffer_params.height; |