mmp / pbrt-v4

Source code to pbrt, the ray tracer described in the forthcoming 4th edition of the "Physically Based Rendering: From Theory to Implementation" book.
https://pbrt.org
Apache License 2.0
2.74k stars 402 forks source link

Build issue vs 2022 cuda 12.5 optix 7.7 win 11 #427

Open DimitryDB opened 3 weeks ago

DimitryDB commented 3 weeks ago

Hi everyone i get this kind of errors while trying to build pbrt 25>tmpxft_00007464_00000000-7_film.cudafe1.cpp 25>C:\Temp\App_Temp\tmpxft_00007464_00000000-7_film.cudafe1.stub.c(31): error C2039: 'cuda': is not a member of 'global namespace'' 25>C:\Temp\App_Temp\tmpxft_00007464_00000000-7_film.cudafe1.stub.c(31): error C2039: 'ranges': is not a member of 'std' 25>D:\Work\dev\PBRT\pbrt-v4\src\pbrt/lights.h(825): note: see declaration of 'std' 25>C:\Temp\App_Temp\tmpxft_00007464_00000000-7_film.cudafe1.stub.c(31): error C2039: '__4': is not a member of 'std' 25>D:\Work\dev\PBRT\pbrt-v4\src\pbrt/lights.h(825): note: see declaration of 'std' 25>C:\Temp\App_Temp\tmpxft_00007464_00000000-7_film.cudafe1.stub.c(31): error C2039: '__cpo': is not a member of 'std' 25>D:\Work\dev\PBRT\pbrt-v4\src\pbrt/lights.h(825): note: see declaration of 'std' 25>C:\Temp\App_Temp\tmpxft_00007464_00000000-7_film.cudafe1.stub.c(31): error C3083: 'cuda': the symbol to the left of a '::' must be a type 25>C:\Temp\App_Temp\tmpxft_00007464_00000000-7_film.cudafe1.stub.c(31): error C3083: 'ranges': the symbol to the left of a '::' must be a type 25>C:\Temp\App_Temp\tmpxft_00007464_00000000-7_film.cudafe1.stub.c(31): error C3083: '__4': the symbol to the left of a '::' must be a type 25>C:\Temp\App_Temp\tmpxft_00007464_00000000-7_film.cudafe1.stub.c(31): error C3083: '__cpo': the symbol to the left of a '::' must be a type 25>C:\Temp\App_Temp\tmpxft_00007464_00000000-7_film.cudafe1.stub.c(31): error C2440: 'type cast': cannot convert from 'overloaded-function' to 'char *' 25>C:\Temp\App_Temp\tmpxft_00007464_00000000-7_film.cudafe1.stub.c(31): note: Context does not allow for disambiguation of overloaded function 25>C:\Temp\App_Temp\tmpxft_00007464_00000000-7_film.cudafe1.stub.c(31): error C2660: '__cudaRegisterVar': function does not take 7 arguments 25>C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.5\include\crt/host_runtime.h(197): note: see declaration of '__cudaRegisterVar' 25>C:\Temp\App_Temp\tmpxft_00007464_00000000-7_film.cudafe1.stub.c(31): note: while trying to match the argument list '(void **, char *, const char [133], int, unsigned __int64, int, int)' 25>C:\Temp\App_Temp\tmpxft_00007464_00000000-7_film.cudafe1.stub.c(32): error C2039: 'cuda': is not a member of 'global namespace'' 25>C:\Temp\App_Temp\tmpxft_00007464_00000000-7_film.cudafe1.stub.c(32): error C2039: 'ranges': is not a member of 'std' 25>D:\Work\dev\PBRT\pbrt-v4\src\pbrt/lights.h(825): note: see declaration of 'std' 25>C:\Temp\App_Temp\tmpxft_00007464_00000000-7_film.cudafe1.stub.c(32): error C2039: '4': is not a member of 'std' 25>D:\Work\dev\PBRT\pbrt-v4\src\pbrt/lights.h(825): note: see declaration of 'std' 25>C:\Temp\App_Temp\tmpxft_00007464_00000000-7_film.cudafe1.stub.c(32): error C2039: 'cpo': is not a member of 'std' 25>D:\Work\dev\PBRT\pbrt-v4\src\pbrt/lights.h(825): note: see declaration of 'std' 25>C:\Temp\App_Temp\tmpxft_00007464_00000000-7_film.cudafe1.stub.c(32): error C3083: 'cuda': the symbol to the left of a '::' must be a type 25>C:\Temp\App_Temp\tmpxft_00007464_00000000-7_film.cudafe1.stub.c(32): error C3083: 'ranges': the symbol to the left of a '::' must be a type 25>C:\Temp\App_Temp\tmpxft_00007464_00000000-7_film.cudafe1.stub.c(32): error C3083: '4': the symbol to the left of a '::' must be a type 25>C:\Temp\App_Temp\tmpxft_00007464_00000000-7_film.cudafe1.stub.c(32): error C3083: 'cpo': the symbol to the left of a '::' must be a type 25>C:\Temp\App_Temp\tmpxft_00007464_00000000-7_film.cudafe1.stub.c(32): error C2039: 'iter_move': is not a member of 'std' 25>D:\Work\dev\PBRT\pbrt-v4\src\pbrt/lights.h(825): note: see declaration of 'std' 25>C:\Temp\App_Temp\tmpxft_00007464_00000000-7_film.cudafe1.stub.c(32): error C2065: 'iter_move': undeclared identifier 25>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\BuildCustomizations\CUDA 12.5.targets(799,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.5\bin\nvcc.exe" --use-local-env -ccbin "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\HostX64\x64" -x cu -rdc=true -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.5\include" -I"D:\Work\dev\PBRT\pbrt-v4\src" -I"D:\Work\dev\PBRT\pbrt-v4\src\ext" -I"D:\Work\dev\PBRT\pbrt-v4\src\ext\stb" -I"D:\Work\dev\PBRT\pbrt-v4\src\ext\qoi" -I"D:\Work\dev\PBRT\pbrt-v4\src\ext\openexr\IlmBase\Imath" -I"D:\Work\dev\PBRT\pbrt-v4\src\ext\openexr\IlmBase\Half" -I"D:\Work\dev\PBRT\pbrt-v4\src\ext\openexr\IlmBase\Iex" -I"D:\Work\dev\PBRT\pbrt-v4\src\ext\openexr\OpenEXR\IlmImf" -ID:\Work\dev\PBRT\out\src\ext\openexr\IlmBase\config -ID:\Work\dev\PBRT\out\src\ext\openexr\OpenEXR\config -I"D:\Work\dev\PBRT\pbrt-v4\src\ext\zlib" -ID:\Work\dev\PBRT\out\src\ext\zlib -I"D:\Work\dev\PBRT\pbrt-v4\src\ext\libdeflate" -I"D:\Work\dev\PBRT\pbrt-v4\src\ext\filesystem" -I"D:\Work\dev\PBRT\pbrt-v4\src\ext\ptex\src\ptex" -I"D:\Work\dev\PBRT\pbrt-v4\src\ext\double-conversion" -I"D:\Work\dev\PBRT\pbrt-v4\src\ext\openvdb\nanovdb" -ID:\Work\dev\PBRT\out -I"D:\Work\dev\PBRT\pbrt-v4\src\ext\glfw\include" -I"D:\Work\dev\PBRT\pbrt-v4\src\ext\glad\include" -I"C:\ProgramData\NVIDIA Corporation\OptiX SDK 7.7.0\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.5\include" -G --keep-dir pbrt_lib\x64\Debug -use_fast_math -maxrregcount=0 --machine 64 --compile -cudart static -Xnvlink -suppress-stack-size-warning --gpu-architecture=sm_89 -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 --std=c++17 --expt-relaxed-constexpr --extended-lambda --forward-unknown-to-host-compiler -Xcompiler="/EHsc -Zi -Ob0 /wd4244 /wd4267 /wd4305 /wd4552 /wd4838 /wd4843 /wd26451 /wd26495 /wd4334 /wd4146" -g -D_WINDOWS -DPBRT_IS_MSVC -D_CRT_SECURE_NO_WARNINGS -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DPBRT_IS_WINDOWS -DNOMINMAX -DPBRT_BUILD_GPU_RENDERER -DPBRT_HAS_INTRIN_H -D"PBRT_NOINLINE=declspec(noinline)" -DPBRT_RESTRICT=__restrict -DPBRT_HAVEALIGNED_MALLOC -DPTEX_STATIC -DPBRT_DEBUG_BUILD -D"CMAKE_INTDIR=\"Debug\"" -D_MBCS -DWIN32 -D_WINDOWS -DPBRT_IS_MSVC -D_CRT_SECURE_NO_WARNINGS -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DPBRT_IS_WINDOWS -DNOMINMAX -DPBRT_BUILD_GPU_RENDERER -DPBRT_HAS_INTRIN_H -D"PBRT_NOINLINE=declspec(noinline)" -DPBRT_RESTRICT=__restrict -DPBRT_HAVEALIGNED_MALLOC -DPTEX_STATIC -DPBRT_DEBUG_BUILD -D"CMAKE_INTDIR=\"Debug\"" -Xcompiler "/EHsc /W3 /nologo /Od /FS /Zi /RTC1 /MDd /GR" -Xcompiler "/FdD:\Work\dev\PBRT\out\Debug\libpbrt_d.pdb" -o pbrt_lib.dir\Debug\/src/pbrt/wavefront/film.cpp.obj "D:\Work\dev\PBRT\pbrt-v4\src\pbrt\wavefront\film.cpp"" exited with code 2. 25>Done building project "pbrt_lib.vcxproj" -- FAILED.

Wil-Lee commented 2 weeks ago

Got the same error on Windows 10 with CUDA 12.5 and Opitx 8.0.0.

Wil-Lee commented 2 weeks ago

See https://github.com/mmp/pbrt-v4/issues/429 for a workaround