-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Aten looking for function cusparseDcsrmm2 in cuda 11 header, windows #42406
Description
🐛 Bug
An error occurs when building PyTorch from master regarding "undefined identifiers". It seems that "Aten looking for function cusparseDcsrmm2 in Cuda 11.0.1 header but this is no more" (#40593)
The issue above is the same issue as mine but the resolution failed (building from master). The code cited by @xwang233 (in the issue above, the code:
| #if !defined(_MSC_VER) && defined(__CUDACC__) && CUSPARSE_VERSION >= 10301 // CUDA release >= 10.2 and not windows |
!defined(_MSC_VER) from the if statement, as a temporary fix?
To Reproduce
Steps to reproduce the behavior:
On Windows 10 Home:
- Download and install the latest NVIDIA drivers and Visual Studio 2019 (with Visual C++ and CMake).
- Download and install the latest Cuda Toolkit (Cuda 11).
- Download and install python 3.8
- Clone the master branch of PyTorch.
- Download and install the PyTorch dependencies.
- In CMD: run "set CMAKE_GENERATOR=Visual Studio 16 2019"
- In the PyTorch repo directory: run "python setup.py install"
Here is the error message: (note: I replaced the user directory with [userDir])
[2479/3308] Building NVCC (Device) object caffe2/CMakeFiles/torch_cuda.dir//aten/src/ATen/native/sparse/cuda/torch_cuda_generated_SparseCUDABlas.cu.obj
FAILED: caffe2/CMakeFiles/torch_cuda.dir//aten/src/ATen/native/sparse/cuda/torch_cuda_generated_SparseCUDABlas.cu.obj
cmd.exe /C "cd /D C:[userDir]\git\repos\pytorch\build\caffe2\CMakeFiles\torch_cuda.dir__\aten\src\ATen\native\sparse\cuda && "C:\Program Files\Python38\Lib\site-packages\cmake\data\bin\cmake.exe" -E make_directory C:/[userDir]/git/repos/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir//aten/src/ATen/native/sparse/cuda/. && "C:\Program Files\Python38\Lib\site-packages\cmake\data\bin\cmake.exe" -D verbose:BOOL=OFF -D build_configuration:STRING=Release -D generated_file:STRING=C:/[userDir]/git/repos/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir//aten/src/ATen/native/sparse/cuda/./torch_cuda_generated_SparseCUDABlas.cu.obj -D generated_cubin_file:STRING=C:/[userDir]/git/repos/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir//aten/src/ATen/native/sparse/cuda/./torch_cuda_generated_SparseCUDABlas.cu.obj.cubin.txt -P C:/[userDir]/git/repos/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir//aten/src/ATen/native/sparse/cuda/torch_cuda_generated_SparseCUDABlas.cu.obj.Release.cmake"
SparseCUDABlas.cu
C:/[userDir]/git/repos/pytorch/aten/src/ATen/native/sparse/cuda/SparseCUDABlas.cu(231): error: identifier "cusparseScsrmm2" is undefined
C:/[userDir]/git/repos/pytorch/aten/src/ATen/native/sparse/cuda/SparseCUDABlas.cu(254): error: identifier "cusparseDcsrmm2" is undefined
2 errors detected in the compilation of "C:/[userDir]/git/repos/pytorch/aten/src/ATen/native/sparse/cuda/SparseCUDABlas.cu".
SparseCUDABlas.cu
CMake Error at torch_cuda_generated_SparseCUDABlas.cu.obj.Release.cmake:281 (message):
Error generating file
C:/[userDir]/git/repos/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/ATen/native/sparse/cuda/./torch_cuda_generated_SparseCUDABlas.cu.obj
Expected behavior
The build should complete successfully. I haven't made any modifications to the clone.
Environment
GPU: GeForce GT 710 (compute capability: 3.5)
PyTorch version: N/A
Is debug build: N/A
CUDA used to build PyTorch: N/A
OS: Microsoft Windows 10 Home
GCC version: Could not collect
CMake version: version 3.18.0
Python version: 3.8
Is CUDA available: N/A
CUDA runtime version: Could not collect
GPU models and configuration: GPU 0: GeForce GT 710
Nvidia driver version: 451.67
cuDNN version: Could not collect
Versions of relevant libraries:
[pip3] numpy==1.18.4
[conda] Could not collect
cc @ezyang @gchanan @zou3519 @malfet @ngimel @peterjc123 @maxluk @nbcsm @guyang3532 @gunandrose4u @smartcat2010 @mszhanyi