shamanDevel / DiffDVR

Differentiable Direct Volume Rendering - Source Code
Other
36 stars 11 forks source link

nvcc exited with code 1 #7

Closed bopan3 closed 1 year ago

bopan3 commented 2 years ago

Hi Sebastian, Now I have successfully run cmake. However, when I use VS2022 to open the solution file generated by cmake and build the Renderer project, I find there are 4 similar errors as show in the end. It seems my nvcc fails to compile due to some reason. Do you have any clue? One strange thing I notice is that the commend uses cuda v11.7, but actually my NVCC_INCLUDE_DIR is set for v11.6. I used to use 11.7 in my windows PC, but I have just switch to v11.6 to be compatible with pytorch 1.12.1. Thanks a lot!

(below is one of the error, all four errors are similar but for different files) Error MSB3721 The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\bin\nvcc.exe" -gencode=arch=compute_61,code=\"sm_61,compute_61\" -gencode=arch=compute_61,code=\"sm_61,compute_61\" -gencode=arch=compute_61,code=\"compute_61,compute_61\" -gencode=arch=compute_61,code=\"sm_61,compute_61\" -gencode=arch=compute_72,code=\"compute_72,compute_72\" -gencode=arch=compute_72,code=\"sm_72,compute_72\" -gencode=arch=compute_61,code=\"sm_61,compute_61\" --use-local-env -ccbin "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\bin\HostX64\x64" -x cu -IC:\Users\Administrator\Documents\GitHub\DiffDVR\renderer -IC:\ProgramData\Anaconda3\envs\diffDVR\include -IC:\Users\Administrator\Desktop\OpenGL\includes\glm -I"C:\ProgramData\Anaconda3\envs\diffDVR\Lib\site-packages\torch\include" -I"C:\ProgramData\Anaconda3\envs\diffDVR\Lib\site-packages\torch\include\torch\csrc\api\include" -I"C:\Users\Administrator\Documents\GitHub\DiffDVR\third-party\cuMat" -I"C:\Users\Administrator\Documents\GitHub\DiffDVR\third-party\magic_enum\include" -I"C:\Users\Administrator\Documents\GitHub\DiffDVR\third-party\cudad\include\cudAD" -I"C:\Users\Administrator\Documents\GitHub\DiffDVR\third-party\tinyformat" -I"C:\Users\Administrator\Documents\GitHub\DiffDVR\third-party\lz4\lib" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\include" --keep-dir x64\Debug -use_fast_math -maxrregcount=0 --machine 64 --compile -cudart static -std=c++17 --generate-line-info --expt-relaxed-constexpr --extended-lambda –Xptxas -v -Xcudafe --diag_suppress=cc_clobber_ignored,--diag_suppress=integer_sign_change,--diag_suppress=useless_using_declaration,--diag_suppress=set_but_not_used,--diag_suppress=field_without_dll_interface,--diag_suppress=base_class_has_different_dll_interface,--diag_suppress=dll_interface_conflict_none_assumed,--diag_suppress=dll_interface_conflict_dllexport_assumed,--diag_suppress=implicit_return_from_non_void_function,--diag_suppress=unsigned_compare_with_zero,--diag_suppress=declared_but_not_referenced,--diag_suppress=bad_friend_decl --Werror cross-execution-space-call --no-host-device-move-forward --expt-relaxed-constexpr --expt-extended-lambda -std=c++17 --generate-line-info --expt-relaxed-constexpr --extended-lambda –Xptxas -v -std=c++17 -Xcompiler="/EHsc -Zi -Ob0" -g -D_WINDOWS -DONNX_NAMESPACE=onnx_c2 -D"RENDERER_SHADER_DIRS={\"C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer\",\"C:/Users/Administrator/Documents/GitHub/DiffDVR/third-party/cudad/include/cudAD\",}" -DRENDERER_RUNTIME_COMPILATION=1 -D"NVCC_ARGS=\"arch=compute_61,code=sm_61\"" -D"NVCC_INCLUDE_DIR=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/include" -DRENDERER_BUILD_CPU_KERNELS=1 -DUSE_DOUBLE_PRECISION=0 -DNOMINMAX -DCUMAT_SINGLE_THREAD_CONTEXT=1 -DTHRUST_IGNORE_CUB_VERSION_CHECK=1 -D"CMAKE_INTDIR=\"Debug\"" -D_MBCS -DWIN32 -D_WINDOWS -D"RENDERER_SHADER_DIRS={\"C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer\",\"C:/Users/Administrator/Documents/GitHub/DiffDVR/third-party/cudad/include/cudAD\",}" -DRENDERER_RUNTIME_COMPILATION=1 -D"NVCC_ARGS=\"arch=compute_61,code=sm_61\"" -D"NVCC_INCLUDE_DIR=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/include" -DRENDERER_BUILD_CPU_KERNELS=1 -DUSE_DOUBLE_PRECISION=0 -DNOMINMAX -DCUMAT_SINGLE_THREAD_CONTEXT=1 -DTHRUST_IGNORE_CUB_VERSION_CHECK=1 -D"CMAKE_INTDIR=\"Debug\"" -Xcompiler "/EHsc /W1 /nologo /Od /FdC:\Users\Administrator\Documents\GitHub\DiffDVR\build\renderer\Debug\Renderer.pdb /FS /Zi /RTC1 /MDd /GR" -o Renderer.dir\Debug\renderer_cuda_impl.obj "C:\Users\Administrator\Documents\GitHub\DiffDVR\renderer\renderer_cuda_impl.cu"" exited with code 1. Renderer C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\BuildCustomizations\CUDA 11.7.targets 790

bopan3 commented 2 years ago

Here is my cmake output for your reference:

-- Building for: Visual Studio 17 2022 -- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044. -- The C compiler identification is MSVC 19.32.31332.0 -- The CXX compiler identification is MSVC 19.32.31332.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6 (found version "11.6") -- Autodetected CUDA architecture(s): 6.1 -- cuda flags: -gencode=arch=compute_61,code=sm_61 -- final cuda flags: -gencode=arch=compute_61,code=sm_61;-std=c++17;--use_fast_math;--generate-line-info;--expt-relaxed-constexpr;--extended-lambda;–Xptxas;-v -- The CUDA compiler identification is NVIDIA 11.7.99 -- Detecting CUDA compiler ABI info -- Detecting CUDA compiler ABI info - done -- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.7/bin/nvcc.exe - skipped -- Detecting CUDA compile features -- Detecting CUDA compile features - done -- Found CUDAToolkit: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.7/include (found version "11.7.99") -- Found PythonInterp: C:/ProgramData/Anaconda3/envs/diffDVR/python.exe (found suitable version "3.8.8", minimum required is "3.6") -- Found PythonLibs: C:/ProgramData/Anaconda3/envs/diffDVR/libs/python38.lib (found suitable version "3.8.8", minimum required is "3.6") -- Torch found at C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - not found -- Check if compiler accepts -pthread -- Check if compiler accepts -pthread - no -- Found Threads: TRUE -- Caffe2: CUDA detected: 11.7 -- Caffe2: CUDA nvcc is: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/bin/nvcc.exe -- Caffe2: CUDA toolkit directory: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6 -- Caffe2: Header version is: 11.6 -- Found CUDNN: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/lib/x64/cudnn.lib -- Found cuDNN: v8.5.0 (include: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/include, library: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/lib/x64/cudnn.lib) -- C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/lib/x64/nvrtc.lib shorthash is dd482e34 -- Autodetected CUDA architecture(s): 6.1 -- Added CUDA NVCC flags for: -gencode;arch=compute_61,code=sm_61 -- Found Torch: C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/torch.lib -- Torch: full library list: C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/torch.lib;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/c10.lib;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/c10_cuda.lib;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/torch.lib;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/torch_cpu.lib;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/torch_cuda.lib;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/torch_python.lib -- Torch: shared libraries to copy: C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/asmjit.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/c10.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/c10_cuda.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/caffe2_nvrtc.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/cudnn64_8.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/cudnn_adv_infer64_8.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/cudnn_adv_train64_8.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/cudnn_cnn_infer64_8.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/cudnn_cnn_train64_8.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/cudnn_ops_infer64_8.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/cudnn_ops_train64_8.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/cupti64_2022.1.0.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/fbgemm.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/shm.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/torch.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/torch_cpu.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/torch_cuda.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/torch_cuda_cpp.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/torch_cuda_cu.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/torch_global_deps.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/torch_python.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/zlibwapi.dll -- Torch: include directories: C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/include;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/include/torch/csrc/api/include -- Found GLM: C:/Users/Administrator/Desktop/OpenGL/includes/glm -- GLM_INCLUDE_DIR = C:/Users/Administrator/Desktop/OpenGL/includes/glm -- Building with the GUI, searching for OpenGL -- Found OpenGL: opengl32 -- Found GLEW: C:/Users/Administrator/Desktop/volumeGL/includes/gl -- Found GLFW: C:/Users/Administrator/Desktop/OpenGL/includes/GLFW -- Found OpenMP_C: -openmp (found version "2.0") -- Found OpenMP_CXX: -openmp (found version "2.0") -- Found OpenMP: TRUE (found version "2.0") -- renderer kernel directories: {"C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer","C:/Users/Administrator/Documents/GitHub/DiffDVR/third-party/cudad/include/cudAD",} -- renderer kernel files: C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer/cooperative_groups.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer/helper_math.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer/renderer_adjoint.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer/renderer_blending.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer/renderer_camera.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer/renderer_commons.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer/renderer_compareToImage.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer/renderer_interpolation.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer/renderer_kernels.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer/renderer_settings.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer/renderer_tensor.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer/renderer_tf.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer/renderer_utils.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/third-party/cudad/include/cudAD/cmath_cuda.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/third-party/cudad/include/cudAD/forward.h;C:/Users/Administrator/Documents/GitHub/DiffDVR/third-party/cudad/include/cudAD/forward_vector.h;C:/Users/Administrator/Documents/GitHub/DiffDVR/third-party/cudad/include/cudAD/macros.h;C:/Users/Administrator/Documents/GitHub/DiffDVR/third-party/cudad/include/cudAD/optimization.h -- pybind11 v2.6.3 dev1 CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.24/Modules/CMakeDependentOption.cmake:89 (message): Policy CMP0127 is not set: cmake_dependent_option() supports full Condition Syntax. Run "cmake --help-policy CMP0127" for policy details. Use the cmake_policy command to set the policy and suppress this warning. Call Stack (most recent call first): third-party/pybind11/CMakeLists.txt:98 (cmake_dependent_option) This warning is for project developers. Use -Wno-dev to suppress it.

-- Found PythonInterp: C:/ProgramData/Anaconda3/envs/diffDVR/python.exe (found version "3.8.8") -- Found PythonLibs: C:/ProgramData/Anaconda3/envs/diffDVR/libs/python38.lib -- Performing Test HAS_MSVC_GL_LTCG -- Performing Test HAS_MSVC_GL_LTCG - Success -- Configuring done -- Generating done -- Build files have been written to: C:/Users/Administrator/Documents/GitHub/DiffDVR/build

shamanDevel commented 2 years ago

One possible cause might be the mismatch in the CUDA versions. That is a common issue on Windows with CMake and multiple CUDA installations. The CUDA version that Visual Studio selects is determined by the toolkit, not by the version found by find_package(CUDA) or similar. Delete the CMakeCache.txt and re-run cmake with cmake -T cuda=11.6 .. from the build-folder. See also https://cmake.org/cmake/help/latest/variable/CMAKE_GENERATOR_TOOLSET.html#variable:CMAKE_GENERATOR_TOOLSET

bopan3 commented 2 years ago

Hi Sebastian, Thanks for your patient reply. Now it seems every version related to cuda in the output of cmake become 11.6. However, now I encounter an error I have not meet ever before (the output is attached at the end). Does that means I need to manually set some path? currently I just set: set(GLM_INCLUDE_DIR "C:/Users/Administrator/Desktop/OpenGL/includes/glm") set(GLEW_INCLUDE_DIR "C:/Users/Administrator/Desktop/volumeGL/includes/gl") set(GLEW_SHARED_LIBRARY_RELEASE "C:/Windows/System32/glew32.dll") set(GLFW_INCLUDE_DIR "C:/Users/Administrator/Desktop/OpenGL/includes/GLFW") set(GLFW_LIBRARY "C:/Users/Administrator/Desktop/OpenGL/lib/glfw3.lib")

-- Building for: Visual Studio 17 2022 -- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044. -- The C compiler identification is MSVC 19.32.31332.0 -- The CXX compiler identification is MSVC 19.32.31332.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6 (found version "11.6") -- Autodetected CUDA architecture(s): 6.1 -- cuda flags: -gencode=arch=compute_61,code=sm_61 -- final cuda flags: -gencode=arch=compute_61,code=sm_61;-std=c++17;--use_fast_math;--generate-line-info;--expt-relaxed-constexpr;--extended-lambda;–Xptxas;-v -- The CUDA compiler identification is NVIDIA 11.6.55 -- Detecting CUDA compiler ABI info -- Detecting CUDA compiler ABI info - done -- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/bin/nvcc.exe - skipped -- Detecting CUDA compile features -- Detecting CUDA compile features - done -- Found CUDAToolkit: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/include (found version "11.6.55") -- Found PythonInterp: C:/ProgramData/Anaconda3/python.exe (found suitable version "3.9.12", minimum required is "3.6") -- Found PythonLibs: C:/ProgramData/Anaconda3/libs/python39.lib (found suitable version "3.9.12", minimum required is "3.6") -- Torch found at / CMake Error at CMakeLists.txt:105 (find_package): By not providing "FindTorch.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Torch", but CMake did not find one.

Could not find a package configuration file provided by "Torch" with any of the following names:

TorchConfig.cmake
torch-config.cmake

Add the installation prefix of "Torch" to CMAKE_PREFIX_PATH or set "Torch_DIR" to a directory containing one of the above files. If "Torch" provides a separate development package or SDK, be sure it has been installed.

-- Configuring incomplete, errors occurred! See also "C:/Users/Administrator/Documents/GitHub/DiffDVR/build/CMakeFiles/CMakeOutput.log".

shamanDevel commented 2 years ago

If you look at the path to Python in the first log and the second log you sent me, you notice that in the first log, the path was set to python executable in the diffDVR environment, in the second one it was set to the global python installation. Did you forget to activate the diffDVR anaconda environment before launching CMake anew with a clear CMakeCache and the correct cuda toolkit?

bopan3 commented 2 years ago

Hi Sebastian, Sorry for the stupid mistake I just made. Yes, I forget to activate diffDVR. Not I successfully pass the cmake, but the build error for Render persists. Do you have any other clue or solutions?

Error MSB3721 The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin\nvcc.exe" -gencode=arch=compute_61,code=\"sm_61,compute_61\" -gencode=arch=compute_61,code=\"sm_61,compute_61\" -gencode=arch=compute_61,code=\"compute_61,compute_61\" -gencode=arch=compute_61,code=\"sm_61,compute_61\" -gencode=arch=compute_72,code=\"compute_72,compute_72\" -gencode=arch=compute_72,code=\"sm_72,compute_72\" -gencode=arch=compute_61,code=\"sm_61,compute_61\" --use-local-env -ccbin "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\bin\HostX64\x64" -x cu -IC:\Users\Administrator\Documents\GitHub\DiffDVR\renderer -IC:\ProgramData\Anaconda3\envs\diffDVR\include -IC:\Users\Administrator\Desktop\OpenGL\includes\glm -I"C:\ProgramData\Anaconda3\envs\diffDVR\Lib\site-packages\torch\include" -I"C:\ProgramData\Anaconda3\envs\diffDVR\Lib\site-packages\torch\include\torch\csrc\api\include" -I"C:\Users\Administrator\Documents\GitHub\DiffDVR\third-party\cuMat" -I"C:\Users\Administrator\Documents\GitHub\DiffDVR\third-party\magic_enum\include" -I"C:\Users\Administrator\Documents\GitHub\DiffDVR\third-party\cudad\include\cudAD" -I"C:\Users\Administrator\Documents\GitHub\DiffDVR\third-party\tinyformat" -I"C:\Users\Administrator\Documents\GitHub\DiffDVR\third-party\lz4\lib" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\include" --keep-dir x64\Debug -use_fast_math -maxrregcount=0 --machine 64 --compile -cudart static -std=c++17 --generate-line-info --expt-relaxed-constexpr --extended-lambda –Xptxas -v -Xcudafe --diag_suppress=cc_clobber_ignored,--diag_suppress=integer_sign_change,--diag_suppress=useless_using_declaration,--diag_suppress=set_but_not_used,--diag_suppress=field_without_dll_interface,--diag_suppress=base_class_has_different_dll_interface,--diag_suppress=dll_interface_conflict_none_assumed,--diag_suppress=dll_interface_conflict_dllexport_assumed,--diag_suppress=implicit_return_from_non_void_function,--diag_suppress=unsigned_compare_with_zero,--diag_suppress=declared_but_not_referenced,--diag_suppress=bad_friend_decl --Werror cross-execution-space-call --no-host-device-move-forward --expt-relaxed-constexpr --expt-extended-lambda -std=c++17 --generate-line-info --expt-relaxed-constexpr --extended-lambda –Xptxas -v -std=c++17 -Xcompiler="/EHsc -Zi -Ob0" -g -D_WINDOWS -DONNX_NAMESPACE=onnx_c2 -D"RENDERER_SHADER_DIRS={\"C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer\",\"C:/Users/Administrator/Documents/GitHub/DiffDVR/third-party/cudad/include/cudAD\",}" -DRENDERER_RUNTIME_COMPILATION=1 -D"NVCC_ARGS=\"arch=compute_61,code=sm_61\"" -D"NVCC_INCLUDE_DIR=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/include" -DRENDERER_BUILD_CPU_KERNELS=1 -DUSE_DOUBLE_PRECISION=0 -DNOMINMAX -DCUMAT_SINGLE_THREAD_CONTEXT=1 -DTHRUST_IGNORE_CUB_VERSION_CHECK=1 -D"CMAKE_INTDIR=\"Debug\"" -D_MBCS -DWIN32 -D_WINDOWS -D"RENDERER_SHADER_DIRS={\"C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer\",\"C:/Users/Administrator/Documents/GitHub/DiffDVR/third-party/cudad/include/cudAD\",}" -DRENDERER_RUNTIME_COMPILATION=1 -D"NVCC_ARGS=\"arch=compute_61,code=sm_61\"" -D"NVCC_INCLUDE_DIR=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/include" -DRENDERER_BUILD_CPU_KERNELS=1 -DUSE_DOUBLE_PRECISION=0 -DNOMINMAX -DCUMAT_SINGLE_THREAD_CONTEXT=1 -DTHRUST_IGNORE_CUB_VERSION_CHECK=1 -D"CMAKE_INTDIR=\"Debug\"" -Xcompiler "/EHsc /W1 /nologo /Od /FdC:\Users\Administrator\Documents\GitHub\DiffDVR\build\renderer\Debug\Renderer.pdb /FS /Zi /RTC1 /MDd /GR" -o Renderer.dir\Debug\renderer_cuda_impl.obj "C:\Users\Administrator\Documents\GitHub\DiffDVR\renderer\renderer_cuda_impl.cu"" exited with code 1. Renderer C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\BuildCustomizations\CUDA 11.6.targets 790

bopan3 commented 2 years ago

Another clue is that when I try to build Renderer-kernels, I find there are also many errors and warnings of the same type: for example:

Warning MSB8065 Custom build for item "C:\Users\Administrator\Documents\GitHub\DiffDVR\build\CMakeFiles\7db998e53d2b8c190076e8be28ffedc4\cooperative_groups.cuh.cpp.rule" succeeded, but specified output "c:\users\administrator\documents\github\diffdvr\build__cmrc_renderer-kernels\intermediate\renderer\cooperative_groups.cuh.cpp" has not been created. This may cause incremental build to work incorrectly. Renderer-kernels C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets 245

Error C1083 Cannot open source file: 'C:\Users\Administrator\Documents\GitHub\DiffDVR\build__cmrc_Renderer-kernels\intermediate\renderer\cooperative_groups.cuh.cpp': No such file or directory Renderer-kernels C:\Users\Administrator\Documents\GitHub\DiffDVR\build\c1xx 1

shamanDevel commented 2 years ago

Ok, so we are now in the realm of speculation. I'm on the move at the moment and can't try out the code myself. Let's see

The error that the file cooperative_groups.cuh.cpp indicates, that the CMRC resource generator did not run successfully. This is strange, because that is a stage in the cmake configuration step, not in the actual build process. But cmake did run and finish, didn't it? Can you check if you see messages about generating resource files? Can you check if those cmrc-folders exist and contain the missing .cpp files? For context: For runtime compilation, the source files of the kernels have to be available in the executable. CMRC is a CMake resource compiler that creates .cpp files with a big, static char array that encodes the resources.

Another possible avenue would be to remove setting RENDERER_SHADER_DIRS via add_definitions in CMake. This can sometimes give problems with escaping of the special characters in there. Instead, hardcode the content of this variable (you see it in the compiler log) in kernel_loader.cpp, where it is used to enumerate the source directories.

bopan3 commented 2 years ago

Hi Sebastian, I just delete everything inside the build folder and re-run "cmake -T cuda=11.6 .." to check. Yes, cmake did run and finish (the output is attached in Appendix). As for CMRC resources, I see "# resources file(DOWNLOAD "https://raw.githubusercontent.com/vector-of-bool/cmrc/master/CMakeRC.cmake" "${CMAKE_BINARY_DIR}/CMakeRC.cmake")" in the top level cmake file, but the CMakeRC.cmake file is empty after the build is done. And I see the folder "C:\Users\Administrator\Documents\GitHub\DiffDVR\build__cmrc_Renderer-kernels\intermediate\renderer" exists but is empty. I think that's the problem. And I find in the top-level cmake file the option RENDERER_SHARED_LIB is set to off by default, I don't know what it is for and if it is relevant.

For the other possible avenue you mentioned, I cannot find where in cmake file we set RENDERER_SHADER_DIRS via add_definitions. Could you provide me with more clue on that if possible?

Appendix 1: top level cmake file:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
cmake_minimum_required(VERSION 3.16)
project(DifferentiableDVR)

cmake_policy(SET CMP0074 NEW) \# use _ROOT environment variables
cmake_policy(SET CMP0091 NEW) \# set runtime library
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)

set(GLM_INCLUDE_DIR "C:/Users/Administrator/Desktop/OpenGL/includes/glm")
set(GLEW_INCLUDE_DIR "C:/Users/Administrator/Desktop/volumeGL/includes/gl")
set(GLEW_SHARED_LIBRARY_RELEASE "C:/Windows/System32/glew32.dll")
set(GLFW_INCLUDE_DIR "C:/Users/Administrator/Desktop/OpenGL/includes/GLFW")
set(GLFW_LIBRARY "C:/Users/Administrator/Desktop/OpenGL/lib/glfw3.lib")

####################################
\# MAIN OPTIONS
####################################
OPTION(RENDERER_ONLY_RESOURCES "Only build the kernel resources, for the UNIX server where the main building is done in setup.py" OFF)
OPTION(RENDERER_BUILD_GUI "Build gui project" ON)
OPTION(RENDERER_SHARED_LIB "Build renderer as a shared library, needed only when used as Python extension" OFF)
OPTION(RENDERER_USE_DOUBLE_PRECISION "if double precision should be used (ON) or floats (OFF)")
OPTION(RENDERER_BUILD_TESTS "Build unit test project" ON)
if(RENDERER_USE_DOUBLE_PRECISION)
    add_definitions(-DUSE_DOUBLE_PRECISION=1)
else()
    add_definitions(-DUSE_DOUBLE_PRECISION=0)
endif()
OPTION(RENDERER_BUILD_CPU_KERNELS "Build CPU paths for the rendering kernels in addition to CUDA" ON)

####################################
\# C++ standard
####################################
if(NOT ${RENDERER_ONLY_RESOURCES})
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_definitions(-DNOMINMAX)
if (UNIX)
    link_libraries(stdc++fs)
    set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif(UNIX)
endif()

####################################
\# CUDA
####################################

if(NOT ${RENDERER_ONLY_RESOURCES})
find_package(CUDA REQUIRED)
if(COMMAND CUDA_SELECT_NVCC_ARCH_FLAGS)
    if (WIN32) \# inference-gui
        CUDA_SELECT_NVCC_ARCH_FLAGS(ARCH_FLAGS Auto)
        STRING(REPLACE ";" "=" ARCH_FLAGS2 "${ARCH_FLAGS}")
        LIST(APPEND CUDA_NVCC_FLAGS "${ARCH_FLAGS2}")
        message(STATUS "cuda flags: ${ARCH_FLAGS2}")
    else() \# server
        CUDA_SELECT_NVCC_ARCH_FLAGS(ARCH_FLAGS 6.1)
        LIST(APPEND CUDA_NVCC_FLAGS "-arch=compute_61 -code=sm_61")
    endif()
endif()
list(APPEND CUDA_NVCC_FLAGS "-std=c++17" "--use_fast_math" "--generate-line-info" "--expt-relaxed-constexpr" "--extended-lambda" "–Xptxas" "-v")
set(MY_CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS})
set(CUDA_SEPARABLE_COMPILATION ON)
message(STATUS "final cuda flags: ${MY_CUDA_NVCC_FLAGS}")
enable_language(CUDA)
find_package(CUDAToolkit REQUIRED)

\# cuMat-Settings
add_definitions(-DCUMAT_SINGLE_THREAD_CONTEXT=1 -DTHRUST_IGNORE_CUB_VERSION_CHECK=1)
endif()

####################################
\# Python
####################################

if(NOT ${RENDERER_ONLY_RESOURCES})
set(Python3_ROOT_DIR ${CMAKE_SOURCE_DIR}/env)
find_package(PythonInterp 3.6 REQUIRED)
find_package(PythonLibs 3.6 REQUIRED)
#find_program(VIRTUALENV virtualenv)
#find_package(Python COMPONENTS Interpreter Development)
get_filename_component(PYTHON_DIRECTORY ${PYTHON_EXECUTABLE} DIRECTORY)
endif()

####################################
\# Pytorch
####################################

if(NOT ${RENDERER_ONLY_RESOURCES})
\# find installation path
if(NOT DEFINED ${TORCH_PATH})
    \# query torch path from python
    execute_process(COMMAND CMD /c python -c "import torch.utils.cpp_extension; print(torch.utils.cpp_extension.include_paths()[0])" OUTPUT_VARIABLE TORCH_FIRST_INCLUDE_DIR)
    get_filename_component(TORCH_ROOT ${TORCH_FIRST_INCLUDE_DIR}/../ ABSOLUTE)
    set(TORCH_PATH "${TORCH_ROOT}" CACHE FILEPATH "path to pytorch in the python installation")
    if(NOT (EXISTS ${TORCH_PATH}))
        message( FATAL_ERROR "Pytorch not found, is it not installed in the python distribution ${PYTHON_DIRECTORY}?")
    else()
        message(STATUS "Torch found at ${TORCH_PATH}")
    endif()
else()
    message(STATUS "Manually specifying torch path as ${TORCH_PATH}")
endif()
\# ask Torch's CMake configuration
set(TORCH_CONFIG_PATH "${TORCH_PATH}/share/cmake/Torch" CACHE FILEPATH "possible path where TorchConfig.cmake is located")
list(APPEND CMAKE_PREFIX_PATH ${TORCH_CONFIG_PATH})
find_package(Torch REQUIRED)
\# get libraries (hard coded), copied from torch.utils.cpp_extension.CUDAExtension
set(TORCH_LIBRARY_NAMES
    c10 c10_cuda torch torch_cpu torch_cuda torch_python)
set(TORCH_LIBRARIES ${TORCH_LIBRARY})
FOREACH(LIB_NAME ${TORCH_LIBRARY_NAMES})
  set(LIB_VAR "TORCH_LIB_${LIB_NAME}") \# Name of the variable which stores result of the search
  FIND_LIBRARY(${LIB_VAR} ${LIB_NAME} PATHS ${TORCH_PATH}/lib)
  list(APPEND TORCH_LIBRARIES ${${LIB_VAR}})
ENDFOREACH()
message(STATUS "Torch: full library list: ${TORCH_LIBRARIES}")
\# copy shared library to bin/
file(MAKE_DIRECTORY bin)
file(GLOB TORCH_SHARED_LIBRARIES
    ${TORCH_PATH}/lib/*${CMAKE_SHARED_LIBRARY_SUFFIX})
message(STATUS "Torch: shared libraries to copy: ${TORCH_SHARED_LIBRARIES}")
file(COPY ${TORCH_SHARED_LIBRARIES} DESTINATION ${CMAKE_SOURCE_DIR}/bin/)
\# get include directories
set(TORCH_INCLUDE_DIR "${TORCH_PATH}/include;${TORCH_PATH}/include/torch/csrc/api/include" CACHE FILEPATH "include directory for the pytorch headers")
message(STATUS "Torch: include directories: ${TORCH_INCLUDE_DIR}")
endif()

####################################
\# OpenGL
####################################
if(NOT ${RENDERER_ONLY_RESOURCES})
find_package(GLM REQUIRED)
if (${RENDERER_BUILD_GUI})
    message(STATUS "Building with the GUI, searching for OpenGL")
    find_package(OpenGL REQUIRED)
    find_package(GLEW REQUIRED)
    find_package(GLFW)
    \# if glfw failed, check using PkgConfig
    if(NOT GLFW_FOUND)
        message(STATUS "GLFW could not be found with normal lookup, use PkgConfig instead")
        find_package(PkgConfig REQUIRED)
        pkg_search_module(GLFW REQUIRED glfw3)
    else()
        set(GLFW_LIBRARIES ${GLFW_LIBRARY})
        set(GLFW_INCLUDE_DIRS ${GLFW_INCLUDE_DIR})
    endif()
    \# copy shared libraries
    if (WIN32)
        \# glew dll if running on windows
        string(REPLACE "/lib/" "/bin/" GLEW_BINARY_RELEASEa ${GLEW_SHARED_LIBRARY_RELEASE})
        string(REPLACE ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_SHARED_LIBRARY_SUFFIX} GLEW_BINARY_RELEASE ${GLEW_BINARY_RELEASEa})
        file(COPY ${GLEW_BINARY_RELEASE} DESTINATION ${CMAKE_SOURCE_DIR}/bin/)
        \# glfw dll
        get_filename_component(GLFW_BINARY_DIRECTORY ${GLFW_LIBRARY} DIRECTORY)
        file(COPY ${GLFW_BINARY_DIRECTORY}/glfw3.dll DESTINATION ${CMAKE_SOURCE_DIR}/bin/)
    else()
        \# copy glew, glfw, glm
        file(COPY ${GLEW_SHARED_LIBRARY_RELEASE} DESTINATION ${CMAKE_SOURCE_DIR}/bin/)
    endif()
endif()
endif()

####################################
\# THIRD PARTY
####################################
add_subdirectory(third-party/lz4)
set_property(TARGET lz4 PROPERTY CUDA_ARCHITECTURES 61 72)

####################################
\# THE LIBRARY
####################################
add_subdirectory(renderer)

message(STATUS "renderer kernel files: ${RENDERER_KERNEL_FILES}")
\# resources
file(DOWNLOAD "https://raw.githubusercontent.com/vector-of-bool/cmrc/master/CMakeRC.cmake"
                "${CMAKE_BINARY_DIR}/CMakeRC.cmake")
include("${CMAKE_BINARY_DIR}/CMakeRC.cmake")
cmrc_add_resource_library(
    ${LIBRARY_NAME}-kernels

    ALIAS ${LIBRARY_NAME}::rc
    NAMESPACE kernels

    ${RENDERER_KERNEL_FILES}
    )
#set_property(TARGET ${LIBRARY_NAME}-kernels PROPERTY
#       MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_property(TARGET ${LIBRARY_NAME}-kernels PROPERTY CUDA_ARCHITECTURES 61 72)

####################################
\# TEST APPLICATION
\# depend on the library
####################################
if(NOT ${RENDERER_ONLY_RESOURCES})
add_subdirectory(gui)
endif()

####################################
\# PYTHON BINDINGS
\# depend on the library
####################################
if(NOT ${RENDERER_ONLY_RESOURCES})
add_subdirectory(third-party/pybind11)
add_subdirectory(bindings)
endif()

####################################
\# UNIT TESTS
\# depend on the library
####################################
if(NOT ${RENDERER_ONLY_RESOURCES})
add_subdirectory(unittests)
endif()

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Appendix 2: cmake output

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044.
-- The C compiler identification is MSVC 19.32.31332.0
-- The CXX compiler identification is MSVC 19.32.31332.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6 (found version "11.6")
-- Autodetected CUDA architecture(s):  6.1
-- cuda flags: -gencode=arch=compute_61,code=sm_61
-- final cuda flags: -gencode=arch=compute_61,code=sm_61;-std=c++17;--use_fast_math;--generate-line-info;--expt-relaxed-constexpr;--extended-lambda;–Xptxas;-v
-- The CUDA compiler identification is NVIDIA 11.6.55
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/bin/nvcc.exe - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Found CUDAToolkit: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/include (found version "11.6.55")
-- Found PythonInterp: C:/ProgramData/Anaconda3/envs/diffDVR/python.exe (found suitable version "3.8.8", minimum required is "3.6")
-- Found PythonLibs: C:/ProgramData/Anaconda3/envs/diffDVR/libs/python38.lib (found suitable version "3.8.8", minimum required is "3.6")
-- Torch found at C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - no
-- Found Threads: TRUE
-- Caffe2: CUDA detected: 11.6
-- Caffe2: CUDA nvcc is: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/bin/nvcc.exe
-- Caffe2: CUDA toolkit directory: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6
-- Caffe2: Header version is: 11.6
-- Found CUDNN: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/lib/x64/cudnn.lib
-- Found cuDNN: v8.5.0  (include: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/include, library: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/lib/x64/cudnn.lib)
-- C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/lib/x64/nvrtc.lib shorthash is dd482e34
-- Autodetected CUDA architecture(s):  6.1
-- Added CUDA NVCC flags for: -gencode;arch=compute_61,code=sm_61
-- Found Torch: C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/torch.lib
-- Torch: full library list: C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/torch.lib;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/c10.lib;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/c10_cuda.lib;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/torch.lib;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/torch_cpu.lib;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/torch_cuda.lib;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/torch_python.lib
-- Torch: shared libraries to copy: C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/asmjit.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/c10.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/c10_cuda.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/caffe2_nvrtc.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/cudnn64_8.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/cudnn_adv_infer64_8.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/cudnn_adv_train64_8.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/cudnn_cnn_infer64_8.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/cudnn_cnn_train64_8.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/cudnn_ops_infer64_8.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/cudnn_ops_train64_8.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/cupti64_2022.1.0.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/fbgemm.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/shm.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/torch.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/torch_cpu.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/torch_cuda.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/torch_cuda_cpp.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/torch_cuda_cu.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/torch_global_deps.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/torch_python.dll;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/lib/zlibwapi.dll
-- Torch: include directories: C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/include;C:/ProgramData/Anaconda3/envs/diffDVR/Lib/site-packages/torch/include/torch/csrc/api/include
-- Found GLM: C:/Users/Administrator/Desktop/OpenGL/includes/glm
-- GLM_INCLUDE_DIR = C:/Users/Administrator/Desktop/OpenGL/includes/glm
-- Building with the GUI, searching for OpenGL
-- Found OpenGL: opengl32
-- Found GLEW: C:/Users/Administrator/Desktop/volumeGL/includes/gl
-- Found GLFW: C:/Users/Administrator/Desktop/OpenGL/includes/GLFW
-- Found OpenMP_C: -openmp (found version "2.0")
-- Found OpenMP_CXX: -openmp (found version "2.0")
-- Found OpenMP: TRUE (found version "2.0")
-- renderer kernel directories: {"C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer","C:/Users/Administrator/Documents/GitHub/DiffDVR/third-party/cudad/include/cudAD",}
-- renderer kernel files: C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer/cooperative_groups.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer/helper_math.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer/renderer_adjoint.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer/renderer_blending.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer/renderer_camera.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer/renderer_commons.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer/renderer_compareToImage.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer/renderer_interpolation.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer/renderer_kernels.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer/renderer_settings.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer/renderer_tensor.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer/renderer_tf.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer/renderer_utils.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/third-party/cudad/include/cudAD/cmath_cuda.cuh;C:/Users/Administrator/Documents/GitHub/DiffDVR/third-party/cudad/include/cudAD/forward.h;C:/Users/Administrator/Documents/GitHub/DiffDVR/third-party/cudad/include/cudAD/forward_vector.h;C:/Users/Administrator/Documents/GitHub/DiffDVR/third-party/cudad/include/cudAD/macros.h;C:/Users/Administrator/Documents/GitHub/DiffDVR/third-party/cudad/include/cudAD/optimization.h
-- pybind11 v2.6.3 dev1
CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.24/Modules/CMakeDependentOption.cmake:89 (message):
  Policy CMP0127 is not set: cmake_dependent_option() supports full Condition
  Syntax.  Run "cmake --help-policy CMP0127" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  third-party/pybind11/CMakeLists.txt:98 (cmake_dependent_option)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found PythonInterp: C:/ProgramData/Anaconda3/envs/diffDVR/python.exe (found version "3.8.8")
-- Found PythonLibs: C:/ProgramData/Anaconda3/envs/diffDVR/libs/python38.lib
-- Performing Test HAS_MSVC_GL_LTCG
-- Performing Test HAS_MSVC_GL_LTCG - Success
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/Administrator/Documents/GitHub/DiffDVR/build
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
bopan3 commented 2 years ago

Hi Sebastian, I managed to compile without GUI on a linux docker image (deployed on a commertial cloud server actually), the environment is "Python3.7, CUDA 11.1, cuDNN 8.0.5, Pytorch 1.8.1, Horovod 0.22.1, Ubuntu 18.04, VNC, NVCC11.1, OpenMPI 4.0.0", and I successfully run "/tests/camera/run_entropy2d.py " (during this process I meet exactly the same problems as #2 , a lot of time is saved thanks to your discussion) . However, I can only succesfully run two example volume data (tooth1.json and plume100-linear.json). I have to commend out the example for single_jet.json and c60multi-pw.json because if I don't, I will encounter the error below:

convert relative path to absolute path, load /DiffDVR/pytests/volumes/cvol/C60Large.cvol Traceback (most recent call last): File "./tests/camera/run_entropy2d.py", line 718, in run("./config-files/c60multi-pw.json", "C60multi", "export", False, hemisphere="small") File "./tests/camera/run_entropy2d.py", line 711, in run data = compute(settings_file, name, include_color_in_entropy, save=False, params=params) File "./tests/camera/run_entropy2d.py", line 41, in compute volume = s.load_dataset() File "/DiffDVR/pytests/diffdvr/settings.py", line 58, in load_dataset return pyrenderer.Volume(path) RuntimeError: Illegal magic number

shamanDevel commented 2 years ago

Hi, related to the "Illegal magic number" error, this occurs when the path to the file is wrong, i.e. a file-not-found error. The log says that the volume is loaded from /DiffDVR/pytests/volumes/cvol/C60Large.cvol (absolute path!). The file, however, is available in the repository under pytests/volume/C60Large.cvol. This should be fixed now

shamanDevel commented 2 years ago

Related to RENDERER_SHADER_DIRS, it is set here in the CMake file: https://github.com/shamanDevel/DiffDVR/blob/master/renderer/CMakeLists.txt#L164 And used here https://github.com/shamanDevel/DiffDVR/blob/master/renderer/kernel_loader.cpp#L143 in the source file.

So on windows, can you try removing that line in CMake and hard-code the path in kernel_loader.cpp as following (replaces line 141ff):

int index=0; //this is still the old code
static const char* RENDERER_SHADER_DIRS[] = {"C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer","C:/Users/Administrator/Documents/GitHub/DiffDVR/third-party/cudad/include/cudAD"};
for (const char* rootStr : RENDERER_SHADER_DIRS) { 
 //...

and removing the #ifdef guards for the preprocessor makro.

bopan3 commented 2 years ago

Hi Sebastian,

Related to RENDERER_SHADER_DIRS, it is set here in the CMake file: https://github.com/shamanDevel/DiffDVR/blob/master/renderer/CMakeLists.txt#L164 And used here https://github.com/shamanDevel/DiffDVR/blob/master/renderer/kernel_loader.cpp#L143 in the source file.

So on windows, can you try removing that line in CMake and hard-code the path in kernel_loader.cpp as following (replaces line 141ff):

int index=0; //this is still the old code
static const char* RENDERER_SHADER_DIRS[] = {"C:/Users/Administrator/Documents/GitHub/DiffDVR/renderer","C:/Users/Administrator/Documents/GitHub/DiffDVR/third-party/cudad/include/cudAD"};
for (const char* rootStr : RENDERER_SHADER_DIRS) { 
 //...

and removing the #ifdef guards for the preprocessor makro.

Your instuction above is correct! Now the CMakeRC file is not empty, and so does the folder "C:\Users\Administrator\Documents\GitHub\DiffDVR\build__cmrc_Renderer-kernels\intermediate\renderer", I can now successfully build the Renderer_kernals project. However, when I try to build the Renderer projects, the four errors persists as below (I just show one of them since all four are simialr)

Severity Code Description Project File Line Suppression State Error MSB3721 The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin\nvcc.exe" -gencode=arch=compute_61,code=\"sm_61,compute_61\" -gencode=arch=compute_61,code=\"sm_61,compute_61\" -gencode=arch=compute_61,code=\"compute_61,compute_61\" -gencode=arch=compute_61,code=\"sm_61,compute_61\" -gencode=arch=compute_72,code=\"compute_72,compute_72\" -gencode=arch=compute_72,code=\"sm_72,compute_72\" -gencode=arch=compute_61,code=\"sm_61,compute_61\" --use-local-env -ccbin "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\bin\HostX64\x64" -x cu -IC:\Users\Administrator\Documents\GitHub\DiffDVR\renderer -IC:\ProgramData\Anaconda3\envs\diffDVR\include -IC:\Users\Administrator\Desktop\OpenGL\includes\glm -I"C:\ProgramData\Anaconda3\envs\diffDVR\Lib\site-packages\torch\include" -I"C:\ProgramData\Anaconda3\envs\diffDVR\Lib\site-packages\torch\include\torch\csrc\api\include" -I"C:\Users\Administrator\Documents\GitHub\DiffDVR\third-party\cuMat" -I"C:\Users\Administrator\Documents\GitHub\DiffDVR\third-party\magic_enum\include" -I"C:\Users\Administrator\Documents\GitHub\DiffDVR\third-party\cudad\include\cudAD" -I"C:\Users\Administrator\Documents\GitHub\DiffDVR\third-party\tinyformat" -I"C:\Users\Administrator\Documents\GitHub\DiffDVR\third-party\lz4\lib" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\include" --keep-dir x64\Debug -use_fast_math -maxrregcount=0 --machine 64 --compile -cudart static -std=c++17 --generate-line-info --expt-relaxed-constexpr --extended-lambda –Xptxas -v -Xcudafe --diag_suppress=cc_clobber_ignored,--diag_suppress=integer_sign_change,--diag_suppress=useless_using_declaration,--diag_suppress=set_but_not_used,--diag_suppress=field_without_dll_interface,--diag_suppress=base_class_has_different_dll_interface,--diag_suppress=dll_interface_conflict_none_assumed,--diag_suppress=dll_interface_conflict_dllexport_assumed,--diag_suppress=implicit_return_from_non_void_function,--diag_suppress=unsigned_compare_with_zero,--diag_suppress=declared_but_not_referenced,--diag_suppress=bad_friend_decl --Werror cross-execution-space-call --no-host-device-move-forward --expt-relaxed-constexpr --expt-extended-lambda -std=c++17 --generate-line-info --expt-relaxed-constexpr --extended-lambda –Xptxas -v -std=c++17 -Xcompiler="/EHsc -Zi -Ob0" -g -D_WINDOWS -DONNX_NAMESPACE=onnx_c2 -DRENDERER_RUNTIME_COMPILATION=1 -D"NVCC_ARGS=\"arch=compute_61,code=sm_61\"" -D"NVCC_INCLUDE_DIR=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/include" -DRENDERER_BUILD_CPU_KERNELS=1 -DUSE_DOUBLE_PRECISION=0 -DNOMINMAX -DCUMAT_SINGLE_THREAD_CONTEXT=1 -DTHRUST_IGNORE_CUB_VERSION_CHECK=1 -D"CMAKE_INTDIR=\"Debug\"" -D_MBCS -DWIN32 -D_WINDOWS -DRENDERER_RUNTIME_COMPILATION=1 -D"NVCC_ARGS=\"arch=compute_61,code=sm_61\"" -D"NVCC_INCLUDE_DIR=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/include" -DRENDERER_BUILD_CPU_KERNELS=1 -DUSE_DOUBLE_PRECISION=0 -DNOMINMAX -DCUMAT_SINGLE_THREAD_CONTEXT=1 -DTHRUST_IGNORE_CUB_VERSION_CHECK=1 -D"CMAKE_INTDIR=\"Debug\"" -Xcompiler "/EHsc /W1 /nologo /Od /FdC:\Users\Administrator\Documents\GitHub\DiffDVR\build\renderer\Debug\Renderer.pdb /FS /Zi /RTC1 /MDd /GR" -o Renderer.dir\Debug\losses_impl.obj "C:\Users\Administrator\Documents\GitHub\DiffDVR\renderer\losses_impl.cu"" exited with code 1. Renderer C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\BuildCustomizations\CUDA 11.6.targets 790

bopan3 commented 2 years ago

Hi Sebastian, I decide to first use the linux version to learn and utilize your code, and come back to the windows version later after I understand your code better. If I manage to solve it, I will post the solution here (if it is not a too specific or stupid problem :)

shamanDevel commented 2 years ago

Hi, sounds good. Sorry that I couldn't help you further with the Windows version