[Bf-blender-cvs] [ff430dea663] blender-v2.82-release: Fix rendering motion blur scenes with OptiX failing with CUDA_ERROR_INVALID_CONTEXT

Patrick Mours noreply at git.blender.org
Tue Jan 14 17:48:38 CET 2020


Commit: ff430dea663521f742ff2f8f79b5d7f4978ecc04
Author: Patrick Mours
Date:   Tue Jan 14 17:47:41 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBff430dea663521f742ff2f8f79b5d7f4978ecc04

Fix rendering motion blur scenes with OptiX failing with CUDA_ERROR_INVALID_CONTEXT

Commit baeb11826b9fe5525db6dd05ba5271949079fc1e switched memory
allocation for the motion transform to use CUDA directly, instead of going
through abstractions. But no CUDA context was set active before those
were called, so the calls failed. This fixes that by binding a context beforehand.

===================================================================

M	intern/cycles/device/device_optix.cpp

===================================================================

diff --git a/intern/cycles/device/device_optix.cpp b/intern/cycles/device/device_optix.cpp
index 979ea7dba23..a510e538031 100644
--- a/intern/cycles/device/device_optix.cpp
+++ b/intern/cycles/device/device_optix.cpp
@@ -1432,6 +1432,8 @@ class OptiXDevice : public Device {
           size_t motion_transform_size = sizeof(OptixSRTMotionTransform) +
                                          motion_keys * sizeof(OptixSRTData);
 
+          const CUDAContextScope scope(cuda_context);
+
           CUdeviceptr motion_transform_gpu = 0;
           check_result_cuda_ret(cuMemAlloc(&motion_transform_gpu, motion_transform_size));
           as_mem.push_back(motion_transform_gpu);



More information about the Bf-blender-cvs mailing list