teddykoker / torchsort

Fast, differentiable sorting and ranking in PyTorch
https://pypi.org/project/torchsort/
Apache License 2.0
765 stars 33 forks source link

Hi, NVIDIA CUDA version >= 11.4 does not seem to install successfully. #51

Closed XiaoqiWang closed 2 years ago

XiaoqiWang commented 2 years ago

I tried to install the package in Tesla A100 and GeForce RTX 3090 with CUDA version 11.4 both failed. Can you provide some help please? Thank you very much!

XiaoqiWang commented 2 years ago

E:\conda\lib\site-packages\torch\include\pybind11\cast.h(1429): error: too few arguments for template template parameter "Tuple" detected during instantiation of class "pybind11::detail::tuple_caster<Tuple, Ts...> [with Tuple=std::pair, Ts=<T1, T2>]" (1507): here

  E:\conda\lib\site-packages\torch\include\pybind11\cast.h(1503): error: too few arguments for template template parameter "Tuple"
            detected during instantiation of class "pybind11::detail::tuple_caster<Tuple, Ts...> [with Tuple=std::pair, Ts=<T1, T2>]"
  (1507): here

  2 errors detected in the compilation of "torchsort/isotonic_cuda.cu".
  isotonic_cuda.cu
  error: command 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.4\\bin\\nvcc.exe' failed with exit code 1
teddykoker commented 2 years ago

Hi @XiaoqiWang, what version of PyTorch do you have installed? I have been able to build torchsort just fine in 11.4 on my machine, but I wonder if a different pytorch version is causing the issue.

XiaoqiWang commented 2 years ago

Hi,thank you for your reply. My pytorch version is 1.11.0 + cu113.

teddykoker commented 2 years ago

I see you are on a windows system - what version is your c++ compiler? It seems there may be an issue with pybind and certain versions of visual studio and CUDA, see: https://github.com/facebookresearch/pytorch3d/issues/1024

XiaoqiWang commented 2 years ago

Thanks. I will try these solutions and get back to you as soon as possible.

XiaoqiWang commented 2 years ago

I successfully installed the package on a linux centos7 system, the system's g++ version requires higher than 5.0, otherwise the following error is reported: unrecognized command line option '-std=c++14'

teddykoker commented 2 years ago

Great! Seems like there are some issues with windows and pytorch cuda extensions that may have caused the issue. Glad you were able to install it!