[Bf-blender-cvs] [34b689892b2] master: Fix T51568: CUDA error in viewport render after fix for for OpenCL

Sergey Sharybin noreply at git.blender.org
Mon May 22 12:29:09 CEST 2017


Commit: 34b689892b29d618394c6d17c5d29129500185c4
Author: Sergey Sharybin
Date:   Mon May 22 12:25:04 2017 +0200
Branches: master
https://developer.blender.org/rB34b689892b29d618394c6d17c5d29129500185c4

Fix T51568: CUDA error in viewport render after fix for for OpenCL

Seems re-loading module invalidates memory pointers by the looks of it,
which gives an error on the next kernel call.

Not sure how to move memory pointer from one CUDA module to another one,
so for now simply disabling kernel re-load for CUDA devices. Not ideal,
but better than failing render.

Feature-selective option for CUDA is not an official feature anyway.

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

M	intern/cycles/device/device_cuda.cpp

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

diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp
index 26671bdde28..99537e9a983 100644
--- a/intern/cycles/device/device_cuda.cpp
+++ b/intern/cycles/device/device_cuda.cpp
@@ -225,6 +225,9 @@ public:
 		cuDevice = 0;
 		cuContext = 0;
 
+		cuModule = 0;
+		cuFilterModule = 0;
+
 		split_kernel = NULL;
 
 		need_bindless_mapping = false;
@@ -487,6 +490,16 @@ public:
 
 	bool load_kernels(const DeviceRequestedFeatures& requested_features)
 	{
+		/* TODO(sergey): Support kernels re-load for CUDA devices.
+		 *
+		 * Currently re-loading kernel will invalidate memory pointers,
+		 * causing problems in cuCtxSynchronize.
+		 */
+		if(cuFilterModule && cuModule) {
+			VLOG(1) << "Skipping kernel reload, not currently supported.";
+			return true;
+		}
+
 		/* check if cuda init succeeded */
 		if(cuContext == 0)
 			return false;




More information about the Bf-blender-cvs mailing list