diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-11-15 23:58:55 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-12-31 23:31:08 +0300 |
commit | 9e2e408323f967a3f8b13e27e601ebfaa109ffcd (patch) | |
tree | 9d360aa875afe98747a70c292d30e18f13efa3ec /intern/cycles/device | |
parent | bbf12722edb7d1cfbbdedd6757275ff386211fe0 (diff) |
Cycles: Add logging to OSL and CUDA initialization/compilation
This is what was handy troubleshooting issues in the studio,
plus this is exactly the same thing which would be helpful
when solving issues with paths to compiled shaders and cubins
for standalone repository.
Diffstat (limited to 'intern/cycles/device')
-rw-r--r-- | intern/cycles/device/device_cuda.cpp | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp index 1e008f45c07..bda967c1de3 100644 --- a/intern/cycles/device/device_cuda.cpp +++ b/intern/cycles/device/device_cuda.cpp @@ -25,6 +25,7 @@ #include "cuew.h" #include "util_debug.h" +#include "util_logging.h" #include "util_map.h" #include "util_opengl.h" #include "util_path.h" @@ -209,8 +210,11 @@ public: cubin = path_get(string_printf("lib/kernel_experimental_sm_%d%d.cubin", major, minor)); else cubin = path_get(string_printf("lib/kernel_sm_%d%d.cubin", major, minor)); - if(path_exists(cubin)) + VLOG(1) << "Testing for pre-compiled kernel " << cubin; + if(path_exists(cubin)) { + VLOG(1) << "Using precompiled kernel"; return cubin; + } /* not found, try to use locally compiled kernel */ string kernel_path = path_get("kernel"); @@ -221,10 +225,12 @@ public: else cubin = string_printf("cycles_kernel_sm%d%d_%s.cubin", major, minor, md5.c_str()); cubin = path_user_get(path_join("cache", cubin)); - + VLOG(1) << "Testing for locally compiled kernel " << cubin; /* if exists already, use it */ - if(path_exists(cubin)) + if(path_exists(cubin)) { + VLOG(1) << "Using locally compiled kernel"; return cubin; + } #ifdef _WIN32 if(have_precompiled_kernels()) { @@ -245,6 +251,7 @@ public: } int cuda_version = cuewCompilerVersion(); + VLOG(1) << "Found nvcc " << nvcc << ", CUDA version " << cuda_version; if(cuda_version == 0) { cuda_error_message("CUDA nvcc compiler version could not be parsed."); @@ -1026,15 +1033,30 @@ bool device_cuda_init(void) return result; initialized = true; - - if (cuewInit() == CUEW_SUCCESS) { - if(CUDADevice::have_precompiled_kernels()) + int cuew_result = cuewInit(); + if (cuew_result == CUEW_SUCCESS) { + VLOG(1) << "CUEW initialization succeeded"; + if(CUDADevice::have_precompiled_kernels()) { + VLOG(1) << "Found precompiled kernels"; result = true; + } #ifndef _WIN32 - else if(cuewCompilerPath() != NULL) + else if(cuewCompilerPath() != NULL) { + VLOG(1) << "Found CUDA compiled " << cuewCompilerPath(); result = true; + } + else { + VLOG(1) << "Neither precompiled kernels nor CUDA compiler wad found," + << " unable to use CUDA"; + } #endif } + else { + VLOG(1) << "CUEW initialization failed: " + << ((cuew_result == CUEW_ERROR_ATEXIT_FAILED) + ? "Error setting up atexit() handler" + : "Error opening the library"); + } return result; } |