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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-01-09 20:37:46 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-01-11 02:00:48 +0300
commitd0892a66483cd03d63aec27d11681e572d1f3494 (patch)
treeb33492fb87415bd210409437ebef8763a282a941 /intern/cycles/device/device_cuda.cpp
parent0f4b46cee61277f3a56b202df61e6296e2629125 (diff)
Fix issue with moving CUDA memory to host and multiple devices.
This is not expected to fix all issues. Also adds some more details to error reporting to investigate failures.
Diffstat (limited to 'intern/cycles/device/device_cuda.cpp')
-rw-r--r--intern/cycles/device/device_cuda.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp
index 51d9994ee26..116f4e2a452 100644
--- a/intern/cycles/device/device_cuda.cpp
+++ b/intern/cycles/device/device_cuda.cpp
@@ -829,18 +829,26 @@ public:
status = " in host memory";
/* Replace host pointer with our host allocation. Only works if
- * CUDA memory layout is the same and has no pitch padding. */
- if(pitch_padding == 0 && mem.host_pointer && mem.host_pointer != mem.shared_pointer) {
+ * CUDA memory layout is the same and has no pitch padding. Also
+ * does not work if we move textures to host during a render,
+ * since other devices might be using the memory. */
+ if(!move_texture_to_host && pitch_padding == 0 &&
+ mem.host_pointer && mem.host_pointer != mem.shared_pointer) {
memcpy(mem.shared_pointer, mem.host_pointer, size);
mem.host_free();
mem.host_pointer = mem.shared_pointer;
}
}
+ else {
+ status = " failed, out of host memory";
+ }
+ }
+ else if(mem_alloc_result != CUDA_SUCCESS) {
+ status = " failed, out of device and host memory";
}
if(mem_alloc_result != CUDA_SUCCESS) {
cuda_assert(mem_alloc_result);
- status = " failed, out of memory";
}
if(mem.name) {