diff options
Diffstat (limited to 'disable_cuda.patch')
-rw-r--r-- | disable_cuda.patch | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/disable_cuda.patch b/disable_cuda.patch new file mode 100644 index 000000000000..0c88f145a1d9 --- /dev/null +++ b/disable_cuda.patch @@ -0,0 +1,94 @@ +From 55b64c719a14957c40019bd51ded3ee4931e588d Mon Sep 17 00:00:00 2001 +From: David Bucciarelli <dade916@gmail.com> +Date: Thu, 10 Dec 2020 11:50:13 +0100 +Subject: [PATCH] Fixed compilation when CUDA is disabled but OpenCL is still + enabled + +--- + cmake/SpecializedConfig/Config_Dade.cmake | 2 +- + src/luxcore/luxcore.cpp | 4 +++- + src/slg/engines/oclrenderengine.cpp | 4 +++- + src/slg/engines/pathoclbase/pathoclbase.cpp | 2 ++ + 5 files changed, 10 insertions(+), 3 deletions(-) + +diff --git a/cmake/SpecializedConfig/Config_Dade.cmake b/cmake/SpecializedConfig/Config_Dade.cmake +index c44da9f79..451e5eed6 100644 +--- a/cmake/SpecializedConfig/Config_Dade.cmake ++++ b/cmake/SpecializedConfig/Config_Dade.cmake +@@ -21,7 +21,7 @@ SET(CMAKE_LIBRARY_PATH "/home/david/projects/luxcorerender/LinuxCompile/target-6 + SET(Blosc_USE_STATIC_LIBS "ON") + + # Note: CUDA requires to have enabled OpenCL support too +-#SET(LUXRAYS_DISABLE_CUDA TRUE) ++SET(LUXRAYS_DISABLE_CUDA TRUE) + #SET(LUXRAYS_DISABLE_OPENCL TRUE) + #SET(BUILD_LUXCORE_DLL TRUE) + +diff --git a/src/luxcore/luxcore.cpp b/src/luxcore/luxcore.cpp +index 869141ab3..334a327f6 100644 +--- a/src/luxcore/luxcore.cpp ++++ b/src/luxcore/luxcore.cpp +@@ -202,7 +202,8 @@ Properties luxcore::GetOpenCLDeviceDescs() { + Property(prefix + ".maxmemoryallocsize")((unsigned long long)desc->GetMaxMemoryAllocSize()) << + Property(prefix + ".localmemory")((unsigned long long)deviceLocalMem) << + Property(prefix + ".constmemory")((unsigned long long)deviceConstMem); +- ++ ++#if !defined(LUXRAYS_DISABLE_CUDA) + if (desc->GetType() & DEVICE_TYPE_CUDA_ALL) { + const CUDADeviceDescription *cudaDesc = (CUDADeviceDescription *)desc; + +@@ -210,6 +211,7 @@ Properties luxcore::GetOpenCLDeviceDescs() { + Property(prefix + ".cuda.compute.major")(cudaDesc->GetCUDAComputeCapabilityMajor()) << + Property(prefix + ".cuda.compute.minor")(cudaDesc->GetCUDAComputeCapabilityMinor()); + } ++#endif + } + #endif + +diff --git a/src/slg/engines/oclrenderengine.cpp b/src/slg/engines/oclrenderengine.cpp +index 2d283a421..7b21cd7cf 100644 +--- a/src/slg/engines/oclrenderengine.cpp ++++ b/src/slg/engines/oclrenderengine.cpp +@@ -113,11 +113,12 @@ OCLRenderEngine::OCLRenderEngine(const RenderConfig *rcfg, + } + } + ++#if !defined(LUXRAYS_DISABLE_CUDA) + if (!haveSelectionString && hasCUDADevice) { + // If there is, at least, a CUDA device available, use only CUDA devices + DeviceDescription::Filter(DEVICE_TYPE_CUDA_ALL, selectedDeviceDescs); + } +- ++ + // Enable/Disable Optix according cuda.optix.devices.select string + if ((cudaDeviceCount > 0) && (cudaOptixDeviceConfig.length() > 0)) { + size_t cudaDeviceIndex = 0; +@@ -139,6 +140,7 @@ OCLRenderEngine::OCLRenderEngine(const RenderConfig *rcfg, + } + } + } ++#endif + + oclRenderThreadCount = selectedDeviceDescs.size(); + #endif +diff --git a/src/slg/engines/pathoclbase/pathoclbase.cpp b/src/slg/engines/pathoclbase/pathoclbase.cpp +index 029538fba..783c4f4a2 100644 +--- a/src/slg/engines/pathoclbase/pathoclbase.cpp ++++ b/src/slg/engines/pathoclbase/pathoclbase.cpp +@@ -68,6 +68,7 @@ PathOCLBaseRenderEngine::PathOCLBaseRenderEngine(const RenderConfig *rcfg, + // Add CUDA devices + //-------------------------------------------------------------------------- + ++#if !defined(LUXRAYS_DISABLE_CUDA) + SLG_LOG("CUDA devices used:"); + for (size_t i = 0; i < devs.size(); ++i) { + if (devs[i]->GetDeviceDesc()->GetType() & DEVICE_TYPE_CUDA_ALL) { +@@ -84,6 +85,7 @@ PathOCLBaseRenderEngine::PathOCLBaseRenderEngine(const RenderConfig *rcfg, + hwDev->SetAdditionalCompileOpts(compileOpts); + } + } ++#endif + + //-------------------------------------------------------------------------- + // Add OpenCL devices |