From ff34e489117e0a9f64ca192438d05f28922af6cc Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 7 Nov 2017 03:38:49 +0100 Subject: Cycles: add an extra CUDA synchronize before rendering. It should not be needed as far as I know, but just in case it fixes any of the recent issues like T52572. --- intern/cycles/device/device_cuda.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'intern/cycles/device/device_cuda.cpp') diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp index 4ab3cb9da75..14e3ddc8c7b 100644 --- a/intern/cycles/device/device_cuda.cpp +++ b/intern/cycles/device/device_cuda.cpp @@ -1567,6 +1567,8 @@ public: 0, 0, args, 0)); unmap_pixels((rgba_byte)? rgba_byte: rgba_half); + + cuda_assert(cuCtxSynchronize()); } void shader(DeviceTask& task) @@ -1928,10 +1930,12 @@ public: /* Load texture info. */ load_texture_info(); + /* Synchronize all memory copies before executing task. */ + cuda_assert(cuCtxSynchronize()); + if(task.type == DeviceTask::FILM_CONVERT) { /* must be done in main thread due to opengl access */ film_convert(task, task.buffer, task.rgba_byte, task.rgba_half); - cuda_assert(cuCtxSynchronize()); } else { task_pool.push(new CUDADeviceTask(this, task)); -- cgit v1.2.3