From 746e8df4e00360db11d2397598d4d8d2986d4494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Caron?= Date: Wed, 12 Mar 2025 17:38:12 +0100 Subject: [PATCH] Add cstdint include to rasterizer_impl.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes the error `namespace "std" has no member "uintptr_t"` when trying to build the wheel (as happens with `pip install`) on my machine. Here is a full error log for reference: Building wheel for diff_surfel_rasterization (setup.py) ... error error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [95 lines of output] running bdist_wheel /home/stephane-caron/.micromamba/envs/vision/lib/python3.12/site-packages/torch/utils/cpp_extension.py:529: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend. warnings.warn(msg.format('we could not find ninja.')) running build running build_py creating build/lib.linux-x86_64-cpython-312/diff_surfel_rasterization copying diff_surfel_rasterization/__init__.py -> build/lib.linux-x86_64-cpython-312/diff_surfel_rasterization running build_ext nvcc warning : incompatible redefinition for option 'compiler-bindir', the last value of this option was used /home/stephane-caron/.micromamba/envs/vision/lib/python3.12/site-packages/torch/utils/cpp_extension.py:448: UserWarning: The detected CUDA version (12.8) has a minor version mismatch with the version that was used to compile PyTorch (12.6). Most likely this shouldn't be a problem. warnings.warn(CUDA_MISMATCH_WARN.format(cuda_str_version, torch.version.cuda)) /home/stephane-caron/.micromamba/envs/vision/lib/python3.12/site-packages/torch/utils/cpp_extension.py:458: UserWarning: There are no /home/stephane-caron/.micromamba/envs/vision/bin/x86_64-conda-linux-gnu-c++ version bounds defined for CUDA version 12.8 warnings.warn(f'There are no {compiler_name} version bounds defined for CUDA version {cuda_str_version}') building 'diff_surfel_rasterization._C' extension creating build/temp.linux-x86_64-cpython-312/cuda_rasterizer /home/stephane-caron/.micromamba/envs/vision/lib/python3.12/site-packages/torch/utils/cpp_extension.py:2073: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation. If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST']. warnings.warn( /home/stephane-caron/.micromamba/envs/vision/bin/nvcc -I/home/stephane-caron/.micromamba/envs/vision/include -I/home/stephane-caron/.micromamba/envs/vision/include/torch/csrc/api/include -I/home/stephane-caron/.micromamba/envs/vision/lib/python3.12/site-packages/torch/include -I/home/stephane-caron/.micromamba/envs/vision/include -I/home/stephane-caron/.micromamba/envs/vision/include/python3.12 -c cuda_rasterizer/backward.cu -o build/temp.linux-x86_64-cpython-312/cuda_rasterizer/backward.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -I/home/stephane-caron/src/rubah/vision/third_party/2d-gaussian-splatting/submodules/diff-surfel-rasterization/third_party/glm/ -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1018\" -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=1 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -ccbin /home/stephane-caron/.micromamba/envs/vision/bin/x86_64-conda-linux-gnu-cc -std=c++17 nvcc warning : incompatible redefinition for option 'compiler-bindir', the last value of this option was used nvcc warning : incompatible redefinition for option 'compiler-bindir', the last value of this option was used cuda_rasterizer/auxiliary.h(197): warning #177-D: variable "p_proj" was declared but never referenced float3 p_proj = { p_hom.x * p_w, p_hom.y * p_w, p_hom.z * p_w }; ^ Remark: The warnings can be suppressed with "-diag-suppress " cuda_rasterizer/backward.cu(321): warning #177-D: variable "w" was declared but never referenced const float w = alpha * T; ^ cuda_rasterizer/backward.cu(212): warning #177-D: variable "dL_dmax_dweight" was declared but never referenced float dL_dmax_dweight; ^ cuda_rasterizer/backward.cu(248): warning #177-D: variable "ddelx_dx" was declared but never referenced const float ddelx_dx = 0.5 * W; ^ cuda_rasterizer/backward.cu(249): warning #177-D: variable "ddely_dy" was declared but never referenced const float ddely_dy = 0.5 * H; ^ /home/stephane-caron/.micromamba/envs/vision/bin/nvcc -I/home/stephane-caron/.micromamba/envs/vision/include -I/home/stephane-caron/.micromamba/envs/vision/include/torch/csrc/api/include -I/home/stephane-caron/.micromamba/envs/vision/lib/python3.12/site-packages/torch/include -I/home/stephane-caron/.micromamba/envs/vision/include -I/home/stephane-caron/.micromamba/envs/vision/include/python3.12 -c cuda_rasterizer/forward.cu -o build/temp.linux-x86_64-cpython-312/cuda_rasterizer/forward.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -I/home/stephane-caron/src/rubah/vision/third_party/2d-gaussian-splatting/submodules/diff-surfel-rasterization/third_party/glm/ -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1018\" -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=1 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -ccbin /home/stephane-caron/.micromamba/envs/vision/bin/x86_64-conda-linux-gnu-cc -std=c++17 nvcc warning : incompatible redefinition for option 'compiler-bindir', the last value of this option was used nvcc warning : incompatible redefinition for option 'compiler-bindir', the last value of this option was used cuda_rasterizer/auxiliary.h(197): warning #177-D: variable "p_proj" was declared but never referenced float3 p_proj = { p_hom.x * p_w, p_hom.y * p_w, p_hom.z * p_w }; ^ Remark: The warnings can be suppressed with "-diag-suppress " /home/stephane-caron/.micromamba/envs/vision/bin/nvcc -I/home/stephane-caron/.micromamba/envs/vision/include -I/home/stephane-caron/.micromamba/envs/vision/include/torch/csrc/api/include -I/home/stephane-caron/.micromamba/envs/vision/lib/python3.12/site-packages/torch/include -I/home/stephane-caron/.micromamba/envs/vision/include -I/home/stephane-caron/.micromamba/envs/vision/include/python3.12 -c cuda_rasterizer/rasterizer_impl.cu -o build/temp.linux-x86_64-cpython-312/cuda_rasterizer/rasterizer_impl.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -I/home/stephane-caron/src/rubah/vision/third_party/2d-gaussian-splatting/submodules/diff-surfel-rasterization/third_party/glm/ -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1018\" -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=1 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -ccbin /home/stephane-caron/.micromamba/envs/vision/bin/x86_64-conda-linux-gnu-cc -std=c++17 nvcc warning : incompatible redefinition for option 'compiler-bindir', the last value of this option was used nvcc warning : incompatible redefinition for option 'compiler-bindir', the last value of this option was used cuda_rasterizer/rasterizer_impl.h(24): error: namespace "std" has no member "uintptr_t" std::size_t offset = (reinterpret_cast(chunk) + alignment - 1) & ~(alignment - 1); ^ cuda_rasterizer/rasterizer_impl.h(40): error: identifier "uint32_t" is undefined uint32_t* point_offsets; ^ cuda_rasterizer/rasterizer_impl.h(41): error: identifier "uint32_t" is undefined uint32_t* tiles_touched; ^ cuda_rasterizer/rasterizer_impl.h(49): error: identifier "uint32_t" is undefined uint32_t* n_contrib; ^ cuda_rasterizer/rasterizer_impl.h(58): error: identifier "uint64_t" is undefined uint64_t* point_list_keys_unsorted; ^ cuda_rasterizer/rasterizer_impl.h(59): error: identifier "uint64_t" is undefined uint64_t* point_list_keys; ^ cuda_rasterizer/rasterizer_impl.h(60): error: identifier "uint32_t" is undefined uint32_t* point_list_unsorted; ^ cuda_rasterizer/rasterizer_impl.h(61): error: identifier "uint32_t" is undefined uint32_t* point_list; ^ cuda_rasterizer/rasterizer_impl.cu(184): warning #549-D: variable "binning" is used before its value is set obtain(chunk, binning.point_list, P, 128); ^ Remark: The warnings can be suppressed with "-diag-suppress " 8 errors detected in the compilation of "cuda_rasterizer/rasterizer_impl.cu". error: command '/home/stephane-caron/.micromamba/envs/vision/bin/nvcc' failed with exit code 2 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for diff_surfel_rasterization --- cuda_rasterizer/rasterizer_impl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/cuda_rasterizer/rasterizer_impl.h b/cuda_rasterizer/rasterizer_impl.h index 7245905..26191ac 100644 --- a/cuda_rasterizer/rasterizer_impl.h +++ b/cuda_rasterizer/rasterizer_impl.h @@ -11,6 +11,7 @@ #pragma once +#include #include #include #include "rasterizer.h"