Cannot compile on Windows 11 with CUDA 12.8: warning 221-D
- Dominant language
- C++
- Stars
- 14k
- Forks
- 2.6k
- Avg merge
- 5d 18h
- Merged PRs (30d)
- 6
Description
### Checklist
- [x] I have searched for [similar issues](https://github.com/isl-org/Open3D/issues).
- [x] For Python issues, I have tested with the [latest development wheel](https://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [x] I have checked the [release documentation](https://www.open3d.org/docs/release/) and the [latest documentation](https://www.open3d.org/docs/latest/) (for `main` branch).
### Steps to reproduce the issue
#### I first cloned Open3D by:
```
git clone https://github.com/isl-org/Open3D.git
cd Open3D
```
#### Then, I build Open3D (on Windows 11, with CUDA 12.8) with:
```
mkdir build & cd build
cmake -G "Visual Studio 17 2022" -A x64 -DBUILD_CUDA_MODULE=ON ..
cmake --build . --config Release --target ALL_BUILD
```
### Error message
```shell
>------ Build All started: Project: open3d_mod, Configuration: x64-Release-CUDA ------
MSBuild version 17.12.12+1cce77968 for .NET Framework
Performing update step for 'ext_ipp'
No patch step for 'ext_ipp'
No configure step for 'ext_ipp'
No build step for 'ext_ipp'
No install step for 'ext_ipp'
Completed 'ext_ipp'
3rdparty_glew.vcxproj -> C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\lib\Release\Open3D_3rdparty_glew.lib
3rdparty_imgui.vcxproj -> C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\lib\Release\Open3D_3rdparty_imgui.lib
3rdparty_liblzf.vcxproj -> C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\lib\Release\Open3D_3rdparty_liblzf.lib
3rdparty_qhull_r.vcxproj -> C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\lib\Release\Open3D_3rdparty_qhull_r.lib
3rdparty_qhullcpp.vcxproj -> C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\lib\Release\Open3D_3rdparty_qhullcpp.lib
3rdparty_rply.vcxproj -> C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\lib\Release\Open3D_3rdparty_rply.lib
3rdparty_tinyfiledialogs.vcxproj -> C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\lib\Release\Open3D_3rdparty_tinyfiledialogs.lib
tbb.vcxproj -> C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\msvc_19.42_cxx17_64_mt_release\tbb12.dll
GUI.vcxproj -> C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\cpp\open3d\visualization\gui\GUI.dir\Release\GUI.lib
camera.vcxproj -> C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\cpp\open3d\camera\camera.dir\Release\camera.lib
core.vcxproj -> C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\cpp\open3d\core\core.dir\Release\core.lib
Compiling CUDA source file ..\..\..\..\..\..\cpp\open3d\core\hashmap\CUDA\CreateCUDAHashBackend.cu...
C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\cpp\open3d\core>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\bin\nvcc.exe" --use-local-env -ccbin "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.42.34433\bin\HostX64\x64" -x cu -IC:\Users\user\Documents\Open3D_modified\open3d_mod\cpp -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\cpp\open3d\core\CMakeFiles\core_impl.dir" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\_deps\ext_tbb-src\src\tbb\..\..\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\include" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\assimp\include" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\cutlass\src\ext_cutlass" -IC:\Users\user\Documents\Open3D_modified\open3d_mod\3rdparty\dirent -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\nanoflann\src\ext_nanoflann\include" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\glfw\include" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\turbojpeg\include" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\jsoncpp\include" -IC:\Users\user\Documents\Open3D_modified\open3d_mod\3rdparty\liblzf -IC:\Users\user\Documents\Open3D_modified\open3d_mod\3rdparty\tomasakeninemoeller\include -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\curl\include" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\boringssl\src\ext_boringssl\Release\include" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\libpng\include" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\zlib\include" -IC:\Users\user\Documents\Open3D_modified\open3d_mod\3rdparty\rply\rply -IC:\Users\user\Documents\Open3D_modified\open3d_mod\3rdparty\tinyfiledialogs\include -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\tinygltf\src\ext_tinygltf" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\tinyobjloader\src\ext_tinyobjloader" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\_deps\ext_qhull-src\src" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\poisson\src\ext_poisson" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\_deps\ext_imgui-src" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\zeromq\include" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\zeromq\src\ext_cppzmq" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\msgpack-c\src\ext_msgpack-c\include" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\vtk\src\ext_vtk\include\vtk-9.1" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\uvatlas\include\DirectXMath" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\uvatlas\include" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\mkl_install\include" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\stdgpu\include" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\embree\include" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\embree\src\ext_embree" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\webrtc\src\ext_webrtc\Release\include" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\webrtc\src\ext_webrtc\Release\include\third_party\abseil-cpp" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\webrtc\src\ext_webrtc\Release\include\third_party\jsoncpp\source\include" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\webrtc\src\ext_webrtc\Release\include\third_party\jsoncpp\generated" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\webrtc\src\ext_webrtc\Release\include\third_party\libyuv\include" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\civetweb\include" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\ipp\src\ext_ipp\Library\include" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\eigen\src\ext_eigen" -IC:\Users\user\Documents\Open3D_modified\open3d_mod\3rdparty\glew\include -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\fmt\include" -I"C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\filament\src\ext_filament\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\include" --keep-dir core_impl\x64\Release -maxrregcount=0 --machine 64 --compile -cudart static --allow-unsupported-compiler -std=c++17 -arch=native --Werror cross-execution-space-call,deprecated-declarations --Werror all-warnings --Werror ext-lambda-captures-this --expt-relaxed-constexpr --diag-suppress 2809 --expt-extended-lambda -Xcompiler="-Ob2 /W4,/WX,/Wv:18,/wd4201,/wd4310,/wd4505,/wd4127,/wd4146,/wd4189,/wd4324,/wd4706,/wd4100,/wd4702,/wd4244,/wd4245,/wd4267,/wd4305,/wd4819" -DNDEBUG -D"OPEN3D_CXX_STANDARD=\"17\"" -D"OPEN3D_CXX_COMPILER_ID=\"MSVC\"" -D"OPEN3D_CXX_COMPILER_VERSION=\"19.42.34436.0\"" -D"OPEN3D_CUDA_COMPILER_ID=\"NVIDIA\"" -D"OPEN3D_CUDA_COMPILER_VERSION=\"12.8.61\"" -DZMQ_STATIC -DBUILD_CUDA_MODULE -DBUILD_ISPC_MODULE -DBUILD_GUI -DBUILD_WEBRTC -DWITH_IPP -D_GLIBCXX_USE_CXX11_ABI=1 -DWINDOWS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -DNOMINMAX -D_USE_MATH_DEFINES -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DOPEN3D_STATIC -DOPEN3D_ENABLE_DLL_EXPORTS -D_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING -DTINYGLTF_IMPLEMENTATION -DSTB_IMAGE_IMPLEMENTATION -DSTB_IMAGE_WRITE_IMPLEMENTATION -DTINYOBJLOADER_IMPLEMENTATION -DIPP_VERSION_INT=20211100 -DGLEW_STATIC -DFMT_HEADER_ONLY=0 -DFMT_USE_WINDOWS_H=0 -DFMT_STRING_ALIAS=1 -D"CMAKE_INTDIR=\"Release\"" -D_MBCS -DWIN32 -D_WINDOWS -D_CRT_SECURE_NO_WARNINGS -DNDEBUG -D"OPEN3D_CXX_STANDARD=\"17\"" -D"OPEN3D_CXX_COMPILER_ID=\"MSVC\"" -D"OPEN3D_CXX_COMPILER_VERSION=\"19.42.34436.0\"" -D"OPEN3D_CUDA_COMPILER_ID=\"NVIDIA\"" -D"OPEN3D_CUDA_COMPILER_VERSION=\"12.8.61\"" -DZMQ_STATIC -DBUILD_CUDA_MODULE -DBUILD_ISPC_MODULE -DBUILD_GUI -DBUILD_WEBRTC -DWITH_IPP -D_GLIBCXX_USE_CXX11_ABI=1 -DWINDOWS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -DNOMINMAX -D_USE_MATH_DEFINES -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DOPEN3D_STATIC -DOPEN3D_ENABLE_DLL_EXPORTS -DTINYGLTF_IMPLEMENTATION -DSTB_IMAGE_IMPLEMENTATION -DSTB_IMAGE_WRITE_IMPLEMENTATION -DTINYOBJLOADER_IMPLEMENTATION -DMKL_ILP64 -DIPP_VERSION_INT=20211100 -DGLEW_STATIC -DFMT_HEADER_ONLY=0 -DFMT_USE_WINDOWS_H=0 -DFMT_STRING_ALIAS=1 -D"CMAKE_INTDIR=\"Release\"" -Xcompiler "/EHsc /W4 /nologo /O2 /FS /MT " -Xcompiler "/Fdcore_impl.dir\Release\core_impl.pdb" -o core_impl.dir\Release\CreateCUDAHashBackend.obj "C:\Users\user\Documents\Open3D_modified\open3d_mod\cpp\open3d\core\hashmap\CUDA\CreateCUDAHashBackend.cu"
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\include\cuda\std\detail\libcxx\include\cmath(1032): error #221-D: floating-point value does not fit in required floating-point type
if (__r >= ::nextafter(static_cast<_RealT>(_MaxVal), ((float)(1e+300))))
^
Remark: The warnings can be suppressed with "-diag-suppress "
C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\stdgpu\include\stdgpu\impl\limits_detail.h(644): error #221-D: floating-point value does not fit in required floating-point type
return ((float)((float)(1e+300)));
^
C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\stdgpu\include\stdgpu\impl\limits_detail.h(680): error #221-D: floating-point value does not fit in required floating-point type
return ((double)((float)(1e+300)));
^
C:\Users\user\Documents\Open3D_modified\open3d_mod\out\build\x64-Release-CUDA\stdgpu\include\stdgpu\impl\limits_detail.h(718): error #221-D: floating-point value does not fit in required floating-point type
return ((double)((float)(1e+300)));
^
4 errors detected in the compilation of "C:/Users/user/Documents/Open3D_modified/open3d_mod/cpp/open3d/core/hashmap/CUDA/CreateCUDAHashBackend.cu".
CreateCUDAHashBackend.cu
```
### Open3D, Python and System information
```markdown
- Operating system: Windows 11 64-bit
- Python version: Python 3.11
- System architecture: x64
- Is this a remote workstation?: no
- How did you install Open3D?: build from source
- Compiler version (if built from source): MSVC 19.42.34436
```
### Additional information
The most relevant part of the error is:
```
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\include\cuda\std\detail\libcxx\include\cmath(1032): error #221-D: floating-point value does not fit in required floating-point type
if (__r >= ::nextafter(static_cast<_RealT>(_MaxVal), ((float)(1e+300))))
^
Remark: The warnings can be suppressed with "-diag-suppress "
1 error detected in the compilation of "C:/Users/user/Documents/Open3D_modified/open3d_mod/cpp/open3d/core/hashmap/CUDA/CUDAHashBackendBuffer.cu".
```
I think this is a numeric_limits issue with nvcc.
Following the remark written above, I found a workaround by just ignoring it, by adding an additional line to the CMake file `cmake/Open3DShowAndAbortOnWarning.cmake:`
```cmake
# Host compiler flags
if (MSVC)
set(CUDA_DISABLE_MSVC_WARNINGS ${DISABLE_MSVC_WARNINGS})
string(REPLACE ";" "," CUDA_DISABLE_MSVC_WARNINGS "${CUDA_DISABLE_MSVC_WARNINGS}")
string(APPEND CUDA_FLAGS " -Xcompiler /W4,/WX,${CUDA_DISABLE_MSVC_WARNINGS}")
string(APPEND CUDA_FLAGS " --diag-suppress 221") # numeric limits error (Windows) NEW LINE !!!!!
else()
# reorder breaks builds on Windows, so only enable for other platforms
string(APPEND CUDA_FLAGS " --Werror reorder")
set(CUDA_DISABLE_GNU_CLANG_INTEL_WARNINGS ${DISABLE_GNU_CLANG_INTEL_WARNINGS})
string(REPLACE ";" "," CUDA_DISABLE_GNU_CLANG_INTEL_WARNINGS "${CUDA_DISABLE_GNU_CLANG_INTEL_WARNINGS}")
string(APPEND CUDA_FLAGS " -Xcompiler -Wall,-Wextra,-Werror,${CUDA_DISABLE_GNU_CLANG_INTEL_WARNINGS}")
endif()
```
But should this be actually fixed somehow in a different way?
The only related issue I could find was from a different unrelated project:
https://github.com/microsoft/onnxruntime/issues/22728
which apparently states that this is an MSVC issue, since INFINITY was changed to (float)(1e+300) since a specific version.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.