Skip to content

Aten looking for function cusparseDcsrmm2 in cuda 11 header, windows #42406

@GrimReaper420

Description

@GrimReaper420

🐛 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
) has a comment that states "CUDA release >= 10.2 and not windows", is it safe to remove the !defined(_MSC_VER) from the if statement, as a temporary fix?

To Reproduce

Steps to reproduce the behavior:

On Windows 10 Home:

  1. Download and install the latest NVIDIA drivers and Visual Studio 2019 (with Visual C++ and CMake).
  2. Download and install the latest Cuda Toolkit (Cuda 11).
  3. Download and install python 3.8
  4. Clone the master branch of PyTorch.
  5. Download and install the PyTorch dependencies.
  6. In CMD: run "set CMAKE_GENERATOR=Visual Studio 16 2019"
  7. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: buildBuild system issuesmodule: cudaRelated to torch.cuda, and CUDA support in generalmodule: windowsWindows support for PyTorchtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions