From: Paul Zander <[email-masked]>

insert CUDA_NVCC_FLAGS into the custom nvcc call so we can use CUDAHOSTCXX, e.g. a different gcc version for cuda code
diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt
index 604ccb8..160ee20 100644
--- a/intern/cycles/kernel/CMakeLists.txt
+++ b/intern/cycles/kernel/CMakeLists.txt
@@ -752,6 +752,7 @@ if(WITH_CYCLES_DEVICE_OPTIX AND WITH_CYCLES_CUDA_BINARIES)
       -I "${CMAKE_CURRENT_SOURCE_DIR}/device/cuda"
       --use_fast_math
       -Wno-deprecated-gpu-targets
+      ${CUDA_NVCC_FLAGS}
       -o ${output})
 
     if(WITH_NANOVDB)