From 0fcf17fc72319bc52b793b2f6156a60aed31dc62 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 3 May 2012 23:39:42 +0000 Subject: Possible fix for #31054: cycles viewport rendering not working with CUDA for computation and ATI card for OpenGL. --- intern/cycles/device/device_cuda.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'intern') 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; -- cgit v1.2.3