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:
Diffstat (limited to 'intern/cycles/device/device_cuda.cpp')
-rw-r--r--intern/cycles/device/device_cuda.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp
index 0c08baae3ff..4bead82fe5a 100644
--- a/intern/cycles/device/device_cuda.cpp
+++ b/intern/cycles/device/device_cuda.cpp
@@ -172,10 +172,15 @@ public:
CUresult result;
- if(background)
+ if(background) {
result = cuCtxCreate(&cuContext, 0, cuDevice);
- else
- result = cuGLCtxCreate(&cuContext, 0, cuDevice);
+ }
+ else {
+ if(cuGLCtxCreate(&cuContext, 0, cuDevice) != CUDA_SUCCESS) {
+ result = cuCtxCreate(&cuContext, 0, cuDevice);
+ background = true;
+ }
+ }
if(cuda_error(result))
return;