Cycles: Add option to directly link against CUDA libraries

The main purpose of such linking is to make Blender compatible with
NVidia's debuggers and profilers which are doing some LD_PRELOAD
magic to intercept some function calls. Such magic conflicts with
our CUDA wrangler magic and causes segmentation faults.

The option is disabled by default, so there's no affect on any of
artists.

In order to make Blender linked directly against CUDA library use
the WITH_CUDA_DYNLOAD CMake option (it's marked as advanced).
This commit is contained in:
Sergey Sharybin
2016-01-14 12:24:09 +05:00
parent d67535eea0
commit 2af7637f20
8 changed files with 79 additions and 8 deletions

View File

@@ -29,9 +29,14 @@ set(LIBRARIES
${TIFF_LIBRARY}
${PTHREADS_LIBRARIES}
extern_clew
extern_cuew
)
if(WITH_CUDA_DYNLOAD)
list(APPEND LIBRARIES extern_cuew)
else()
list(APPEND LIBRARIES ${CUDA_CUDA_LIBRARY})
endif()
if(WITH_CYCLES_OSL)
list(APPEND LIBRARIES cycles_kernel_osl)
endif()