Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPU compiling error with -DPBRT_FLOAT_AS_DOUBLE #423

Open
iscaswcm opened this issue Apr 17, 2024 · 1 comment
Open

GPU compiling error with -DPBRT_FLOAT_AS_DOUBLE #423

iscaswcm opened this issue Apr 17, 2024 · 1 comment

Comments

@iscaswcm
Copy link

iscaswcm commented Apr 17, 2024

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 39e01e6

Thanks a lot!

@iscaswcm
Copy link
Author

The problem has been resolved by switching CUDA to version 11.6. Everything is working fine now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant