gsplat icon indicating copy to clipboard operation
gsplat copied to clipboard

cl: error D8021 : /Wno-attributes

Open YananZHOU5555 opened this issue 3 months ago • 0 comments

Hello I meet the following error. Not quite shure what is going on. Hoppefully, someone can help. And claude said it caused by “gsplat's build script incorrectly passes GCC/Clang-specific -Wno-attributes flag to MSVC compiler on Windows”

When I am runnning "python examples/simple_trainer.py default --data_dir D:\gsplat\chess_processed --data_factor 1 --result_dir D:\gsplat\chess_output --max_steps 30000 > full_log.txt 2>&1". The following error can befound in the log file.

ProjectionUT3DGSFused.cu
tmpxft_00007a4c_00000000-7_ProjectionUT3DGSFused.cudafe1.cpp
[12/30] cl /showIncludes -DTORCH_EXTENSION_NAME=gsplat_cuda -DTORCH_API_INCLUDE_EXTENSION_H -ID:\Anaconda\envs\gsplat\lib\site-packages\gsplat\cuda\include -ID:\Anaconda\envs\gsplat\lib\site-packages\gsplat\cuda\csrc\third_party\glm -ID:\Anaconda\envs\gsplat\lib\site-packages\torch\include -ID:\Anaconda\envs\gsplat\lib\site-packages\torch\include\torch\csrc\api\include "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\include" -ID:\Anaconda\envs\gsplat\Include -D_GLIBCXX_USE_CXX11_ABI=0 /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /wd4624 /wd4067 /wd4068 /EHsc /std:c++17 -O3 -Wno-attributes -c D:\Anaconda\envs\gsplat\lib\site-packages\gsplat\cuda\csrc\Adam.cpp /FoAdam.o 
FAILED: [code=2] Adam.o 
cl /showIncludes -DTORCH_EXTENSION_NAME=gsplat_cuda -DTORCH_API_INCLUDE_EXTENSION_H -ID:\Anaconda\envs\gsplat\lib\site-packages\gsplat\cuda\include -ID:\Anaconda\envs\gsplat\lib\site-packages\gsplat\cuda\csrc\third_party\glm -ID:\Anaconda\envs\gsplat\lib\site-packages\torch\include -ID:\Anaconda\envs\gsplat\lib\site-packages\torch\include\torch\csrc\api\include "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\include" -ID:\Anaconda\envs\gsplat\Include -D_GLIBCXX_USE_CXX11_ABI=0 /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /wd4624 /wd4067 /wd4068 /EHsc /std:c++17 -O3 -Wno-attributes -c D:\Anaconda\envs\gsplat\lib\site-packages\gsplat\cuda\csrc\Adam.cpp /FoAdam.o 
     x64    Microsoft (R) C/C++  Ż        19.29.30159   
  Ȩ    (C) Microsoft Corporation          Ȩ    

cl:        error D8021 :  Ч    ֵ      /Wno-attributes  
[13/30] C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\bin\nvcc --generate-dependencies-with-compile --dependency-output IntersectTile.cuda.o.d -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcompiler /EHsc -Xcompiler /wd4068 -Xcompiler /wd4067 -Xcompiler /wd4624 -Xcompiler /wd4190 -Xcompiler /wd4018 -Xcompiler /wd4275 -Xcompiler /wd4267 -Xcompiler /wd4244 -Xcompiler /wd4251 -Xcompiler /wd4819 -Xcompiler /MD -DTORCH_EXTENSION_NAME=gsplat_cuda -DTORCH_API_INCLUDE_EXTENSION_H -ID:\Anaconda\envs\gsplat\lib\site-packages\gsplat\cuda\include -ID:\Anaconda\envs\gsplat\lib\site-packages\gsplat\cuda\csrc\third_party\glm -ID:\Anaconda\envs\gsplat\lib\site-packages\torch\include -ID:\Anaconda\envs\gsplat\lib\site-packages\torch\include\torch\csrc\api\include "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\include" -ID:\Anaconda\envs\gsplat\Include -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_120,code=compute_120 -gencode=arch=compute_120,code=sm_120 -std=c++17 -O3 -use_fast_math -c D:\Anaconda\envs\gsplat\lib\site-packages\gsplat\cuda\csrc\IntersectTile.cu -o IntersectTile.cuda.o 
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.8/include\cuda/std/detail/libcxx/include/cmath(1032): warning #221-D: floating-point value does not fit in required floating-point type
    if (__r >= ::nextafter(static_cast<_RealT>(_MaxVal), ((float)(1e+300))))
RasterizeToPixelsFromWorld3DGSBwd.cu
tmpxft_000096e4_00000000-7_RasterizeToPixelsFromWorld3DGSBwd.cudafe1.cpp
ninja: build stopped: subcommand failed.
No modifications detected for re-loaded extension module gsplat_cuda, skipping build step...
Loading extension module gsplat_cuda...

  0%|          | 0/30000 [00:32<?, ?it/s]
Traceback (most recent call last):
  File "D:\Anaconda\envs\gsplat\lib\site-packages\gsplat\cuda\_backend.py", line 166, in <module>
    from gsplat import csrc as _C
ImportError: cannot import name 'csrc' from 'gsplat' (D:\Anaconda\envs\gsplat\lib\site-packages\gsplat\__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Anaconda\envs\gsplat\lib\site-packages\gsplat\cuda\_backend.py", line 79, in load_extension
    compiled = _jit_compile(
TypeError: _jit_compile() missing 2 required positional arguments: 'verbose' and 'with_sycl'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\gsplat\gsplat_repo\examples\simple_trainer.py", line 1261, in <module>
    cli(main, cfg, verbose=True)
  File "D:\Anaconda\envs\gsplat\lib\site-packages\gsplat\distributed.py", line 360, in cli
    return _distributed_worker(0, 1, fn=fn, args=args)
  File "D:\Anaconda\envs\gsplat\lib\site-packages\gsplat\distributed.py", line 295, in _distributed_worker
    fn(local_rank, world_rank, world_size, args)
  File "D:\gsplat\gsplat_repo\examples\simple_trainer.py", line 1183, in main
    runner.train()
  File "D:\gsplat\gsplat_repo\examples\simple_trainer.py", line 639, in train
    renders, alphas, info = self.rasterize_splats(
  File "D:\gsplat\gsplat_repo\examples\simple_trainer.py", line 517, in rasterize_splats
    render_colors, render_alphas, info = rasterization(
  File "D:\Anaconda\envs\gsplat\lib\site-packages\gsplat\rendering.py", line 409, in rasterization
    proj_results = fully_fused_projection(
  File "D:\Anaconda\envs\gsplat\lib\site-packages\gsplat\cuda\_wrapper.py", line 423, in fully_fused_projection
    return _FullyFusedProjection.apply(
  File "D:\Anaconda\envs\gsplat\lib\site-packages\torch\autograd\function.py", line 575, in apply
    return super().apply(*args, **kwargs)  # type: ignore[misc]
  File "D:\Anaconda\envs\gsplat\lib\site-packages\gsplat\cuda\_wrapper.py", line 1056, in forward
    camera_model_type = _make_lazy_cuda_obj(
  File "D:\Anaconda\envs\gsplat\lib\site-packages\gsplat\cuda\_wrapper.py", line 24, in _make_lazy_cuda_obj
    from ._backend import _C
  File "D:\Anaconda\envs\gsplat\lib\site-packages\gsplat\cuda\_backend.py", line 217, in <module>
    _C = load_extension(
  File "D:\Anaconda\envs\gsplat\lib\site-packages\gsplat\cuda\_backend.py", line 98, in load_extension
    compiled = _jit_compile(
  File "D:\Anaconda\envs\gsplat\lib\site-packages\torch\utils\cpp_extension.py", line 2103, in _jit_compile
    return _import_module_from_library(name, build_directory, is_python_module)
  File "D:\Anaconda\envs\gsplat\lib\site-packages\torch\utils\cpp_extension.py", line 2542, in _import_module_from_library
    module = importlib.util.module_from_spec(spec)
ImportError: DLL load failed while importing gsplat_cuda: 找不到指定的模块。
connection handler failed
Traceback (most recent call last):
  File "D:\Anaconda\envs\gsplat\lib\site-packages\viser\infra\_infra.py", line 416, in ws_handler
    await asyncio.gather(
  File "D:\Anaconda\envs\gsplat\lib\site-packages\viser\infra\_infra.py", line 644, in _message_consumer
    raw = await websocket.recv()
  File "D:\Anaconda\envs\gsplat\lib\site-packages\websockets\asyncio\connection.py", line 322, in recv
    raise self.protocol.close_exc from self.recv_exc
websockets.exceptions.ConnectionClosedOK: sent 1001 (going away); then received 1001 (going away)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Anaconda\envs\gsplat\lib\site-packages\websockets\asyncio\server.py", line 376, in conn_handler
    await self.handler(connection)
  File "D:\Anaconda\envs\gsplat\lib\site-packages\viser\infra\_infra.py", line 446, in ws_handler
    await cb(client_connection)
  File "D:\Anaconda\envs\gsplat\lib\site-packages\viser\_viser.py", line 726, in _
    self._thread_executor.submit(cb, handle).add_done_callback(
  File "D:\Anaconda\envs\gsplat\lib\concurrent\futures\thread.py", line 167, in submit
    raise RuntimeError('cannot schedule new futures after shutdown')
RuntimeError: cannot schedule new futures after shutdown
(viser) Server stopped

The following is my anconda env installation procedure. And I am using 5090 on windows 11 ’‘’

  • Step 1: Create new conda environment with Python 3.9 conda create -n "gsplat" python=3.9 ipython

  • Step 2: Activate environment conda activate gsplat

  • Step 3: Install CUDA Toolkit 12.8 conda install -c nvidia cuda-toolkit=12.8 -y

  • Rename problematic scripts, replace gsplat with your current anaconda environment name ren "D:\Anaconda\envs\gsplat\etc\conda\activate.d\vs2017_get_vsinstall_dir.bat" "vs2017_get_vsinstall_dir.bat.bak" ren "D:\Anaconda\envs\gsplat\etc\conda\activate.d\vs2017_compiler_vars.bat" "vs2017_compiler_vars.bat.bak" ren "D:\Anaconda\envs\gsplat\etc\conda\activate.d~cuda-nvcc_activate.bat" "~cuda-nvcc_activate.bat.bak" ren "D:\Anaconda\envs\gsplat\etc\conda\deactivate.d~cuda-nvcc_deactivate.bat" "~cuda-nvcc_deactivate.bat.bak"

  • Create VS2019 compiler startup script + git + rc.exe path for 3D Gaussian base package compilation environment mkdir "D:\Anaconda\envs\gsplat\etc\conda\activate.d" echo set "PATH=C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64;C:\Program Files\Git\cmd;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64;%%PATH%%" > "D:\Anaconda\envs\gsplat\etc\conda\activate.d\vs2019_path.bat" mkdir "D:\Anaconda\envs\gsplat\etc\conda\deactivate.d" echo @rem PATH will be restored automatically by conda > "D:\Anaconda\envs\gsplat\etc\conda\deactivate.d\vs2019_path_cleanup.bat"

  • Set compiler environment variables conda deactivate conda activate gsplat conda env config vars set INCLUDE="C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\shared" conda env config vars set LIB="C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\lib\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.26100.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.26100.0\um\x64" conda deactivate conda activate gsplat

  • Step 4: Install PyTorch ecosystem (supporting CUDA 12.8) pip install torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1 --index-url https://download.pytorch.org/whl/cu128

  • Verify installation python -c "import sys; import torch; print(f'Python version: {sys.version}'); print(f'PyTorch version: {torch.version}'); print(f'CUDA available: {torch.cuda.is_available()}'); print(f'CUDA version: {torch.version.cuda}')" cl.exe

  • Install fused-ssim separately pip install git+https://github.com/rahul-goel/fused-ssim/ -v --no-build-isolation

  • Install fused-bilagrid separately git clone https://github.com/harry7557558/fused-bilagrid.git cd fused-bilagrid pip install . --no-build-isolation

  • Install gsplat pip install gsplat

  • Removed fused-ssim and fused-bilagrid from examples/requirements.txt pip install -r examples/requirements.txt

  • If you encounter "struct.error: unpack requires a buffer of 4 bytes" error, refer to https://github.com/rmbrualla/pycolmap/pull/2

  • Modify scene_manager.py according to that PR pip uninstall pycolmap git clone https://github.com/rmbrualla/pycolmap.git cd pycolmap python -m pip install -e . ‘’‘

YananZHOU5555 avatar Sep 29 '25 15:09 YananZHOU5555