pbrt-v4
pbrt-v4 copied to clipboard
GPU compiling error with -DPBRT_FLOAT_AS_DOUBLE
Compilation Environment: Operating System Ubuntu 20.04 CUDA 12.3 NVIDIA-OptiX-SDK-8.0.0 GCC 11.4 G++ 11.4 cmake 3.28.1 Compiling PBRT with double precision (-DPBRT_FLOAT_AS_DOUBLE=ON) resulted in the following error:
[ 4%] Building CUDA object CMakeFiles/pbrt_lib.dir/src/pbrt/wavefront/surfscatter.cpp.o
/usr/local/cuda-12.3/bin/nvcc -forward-unknown-to-host-compiler -DPBRT_BUILD_GPU_RENDERER -DPBRT_FLOAT_AS_DOUBLE -DPBRT_HAVE_MMAP -DPBRT_HAVE_POSIX_MEMALIGN -DPBRT_IS_LINUX -DPBRT_NOINLINE="__attribute__((noinline))" -DPBRT_RESTRICT=__restrict__ -DPTEX_STATIC --options-file CMakeFiles/pbrt_lib.dir/includes_CUDA.rsp -Xnvlink -suppress-stack-size-warning --gpu-architecture=sm_80 -O3 -DNDEBUG -std=c++17 -Xcudafe --diag_suppress=partial_override -Xcudafe --diag_suppress=virtual_function_decl_hidden -Xcudafe --diag_suppress=integer_sign_change -Xcudafe --diag_suppress=declared_but_not_referenced -Xcudafe --diag_suppress=implicit_return_from_non_void_function -Xcompiler -march=native --std=c++17 --use_fast_math --expt-relaxed-constexpr --extended-lambda --forward-unknown-to-host-compiler -lineinfo -maxrregcount 128 -MD -MT CMakeFiles/pbrt_lib.dir/src/pbrt/wavefront/surfscatter.cpp.o -MF CMakeFiles/pbrt_lib.dir/src/pbrt/wavefront/surfscatter.cpp.o.d -x cu -rdc=true -c /home/wcm/100API/pbrt-v4-ori/src/pbrt/wavefront/surfscatter.cpp -o CMakeFiles/pbrt_lib.dir/src/pbrt/wavefront/surfscatter.cpp.o
nvcc error : 'cicc' died due to signal 11 (Invalid memory reference)
nvcc error : 'cicc' core dumped
make[2]: *** [CMakeFiles/pbrt_lib.dir/build.make:1143: CMakeFiles/pbrt_lib.dir/src/pbrt/wavefront/surfscatter.cpp.o] Error 139
make[2]: Leaving directory '/home/wcm/100API/pbrt-v4-ori/build'
make[1]: *** [CMakeFiles/Makefile2:468: CMakeFiles/pbrt_lib.dir/all] Error 2
make[1]: Leaving directory '/home/wcm/100API/pbrt-v4-ori/build'
make: *** [Makefile:149: all] Error 2
Compiling with single precision (-DPBRT_FLOAT_AS_DOUBLE=OFF) compiles successfully:
/usr/local/cuda-12.1/bin/nvcc -forward-unknown-to-host-compiler -DPBRT_BUILD_GPU_RENDERER -DPBRT_FLOAT_AS_DT_HAVE_POSIX_MEMALIGN -DPBRT_IS_LINUX -DPBRT_NOINLINE="attribute((noinline))" -DPBRT_RESTRICT=restrict -DPTEX_STATIC --lib.dir/includes_CUDA.rsp -Xnvlink -suppress-stack-size-warning --gpu-architecture=sm_80 -O3 -DNDEBUG -std=c++17 -Xcudafe --diaXcudafe --diag_suppress=virtual_function_decl_hidden -Xcudafe --diag_suppress=integer_sign_change -Xcudafe --diag_suppress=declafe --diag_suppress=implicit_return_from_non_void_function -Xcompiler -march=native --std=c++17 --use_fast_math --expt-relaxed--forward-unknown-to-host-compiler -lineinfo -maxrregcount 128 -MD -MT CMakeFiles/pbrt_lib.dir/src/pbrt/wavefront/surfscatter.cpir/src/pbrt/wavefront/surfscatter.cpp.o.d -x cu -rdc=true -c /home/wcm/100API/pbrt-v4-ori/src/pbrt/wavefront/surfscatter.cpp -opbrt/wavefront/surfscatter.cpp.o
It's OK!
PBRT is the latest version, git commit ID: commit 39e01e61f8de07b99859df04b271a02a53d9aeb2
Thanks a lot!
The problem has been resolved by switching CUDA to version 11.6. Everything is working fine now.