facebookresearch / pytorch3d

PyTorch3D is FAIR's library of reusable components for deep learning with 3D data
https://pytorch3d.org/
Other
8.81k stars 1.32k forks source link

C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/include\cub/device/dispatch/dispatch_segmented_sort.cuh(338): error: expected an identifier C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/include\cub/device/dispatch/dispatch_segmented_sort.cuh(379): error: expected a member name #1614

Closed lucasjinreal closed 1 year ago

lucasjinreal commented 1 year ago
  C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/include\cub/device/dispatch/dispatch_segmented_sort.cuh(338): error: expected an identifier

  C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/include\cub/device/dispatch/dispatch_segmented_sort.cuh(379): error: expected a member name
bottler commented 1 year ago

This is an error seen in https://github.com/facebookresearch/pytorch3d/issues/1227, but no one has really got to the bottom of it I think.

lucasjinreal commented 1 year ago

the bottom was locked by meta.

bottler commented 1 year ago

(Now reopened. I think it may have been getting unrelated comments ages ago.) I see that one comment elsewhere suggested fixing a similar problem by upgrading to cub 1.16.0

zhangheng815323856 commented 1 year ago
  C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/include\cub/device/dispatch/dispatch_segmented_sort.cuh(338): error: expected an identifier

  C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/include\cub/device/dispatch/dispatch_segmented_sort.cuh(379): error: expected a member name

Just had the same error when building with CUDA 11.8 and PyTorch 2.0.1 under Windows 11. Add the "-DWIN32_LEAN_AND_MEAN" flag to the nvcc_args in setup.py. This helped me.

lucasjinreal commented 1 year ago

For anyone get this error as well, I now successfully build pytorch3d on windows, here is the result:

image

Be note, this is not CUDA117, am using CUDA12.1

Don't know it's only cuda118 issue or anything else, but CUDA12.1 just worked.

As well, I added -DWIN32_LEAN_AND_MEAN suggested by @zhangheng815323856

It will work.

karaokenoway commented 8 months ago
  C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/include\cub/device/dispatch/dispatch_segmented_sort.cuh(338): error: expected an identifier

  C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/include\cub/device/dispatch/dispatch_segmented_sort.cuh(379): error: expected a member name

Just had the same error when building with CUDA 11.8 and PyTorch 2.0.1 under Windows 11. Add the "-DWIN32_LEAN_AND_MEAN" flag to the nvcc_args in setup.py. This helped me.

i just had the same problem, under the same environment but in window10 , i already add this nvcc_args = [ "-DWIN32_LEAN_AND_MEAN" ##add "-DCUDA_HAS_FP16=1", "-DCUDA_NO_HALF_OPERATORS", "-DCUDA_NO_HALF_CONVERSIONS", "-D__CUDA_NO_HALF2_OPERATORS__", ]to the setup.py but still come the same error..... @zhangheng815323856 can you help me plz!

bottler commented 8 months ago

@karaokenoway Please open a new issue.

zhenga90 commented 6 months ago
  C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/include\cub/device/dispatch/dispatch_segmented_sort.cuh(338): error: expected an identifier

  C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/include\cub/device/dispatch/dispatch_segmented_sort.cuh(379): error: expected a member name

Just had the same error when building with CUDA 11.8 and PyTorch 2.0.1 under Windows 11. Add the "-DWIN32_LEAN_AND_MEAN" flag to the nvcc_args in setup.py. This helped me.

i just had the same problem, under the same environment but in window10 , i already add this nvcc_args = [ "-DWIN32_LEAN_AND_MEAN" ##add "-DCUDA_HAS_FP16=1", "-DCUDA_NO_HALF_OPERATORS", "-DCUDA_NO_HALF_CONVERSIONS", "-D__CUDA_NO_HALF2_OPERATORS__", ]to the setup.py but still come the same error..... @zhangheng815323856 can you help me plz!

you missed comma(",") after adding content("-DWIN32_LEAN_AND_MEAN")