본문 바로가기
Other

‘CUSPARSE_SPMV_ALG_DEFAULT’ was not declared in this scope Error 해결

by wisejlog 2022. 8. 30.

필자는 기존에 CUDA 11.1 + pytorch3d 1.9.0 을 사용하여 개발을 진행하고 있었다. 

 

colmap 어플리케이션을 활용하기 위해 Ubuntu 20.04에 colmap을 설치하던 와중 

다음 가이드 사용 - (https://colmap.github.io/install.html)

 

Installation — COLMAP 3.8 documentation

COLMAP builds on all major platforms (Linux, Mac, Windows) with little effort. First, checkout the latest source code: The latest stable version lives in the master branch and the latest development version lives in the dev branch. On Linux and Mac it is g

colmap.github.io

 

다음과 같은 로그를 확인하게 된다.

 

 error: ‘CUSPARSE_SPMV_ALG_DEFAULT’ was not declared in this scope; did you mean ‘CUSPARSE_SPMM_ALG_DEFAULT’?

 

문제가 되는 파일이었던 cuda_sparse_matrix.cc파일을 확인해보면 아래와 같이 CUSPARSE_SPMV_ALG_DEFAULT 를 사용하는 것으로 보이는데,

https://docs.nvidia.com/cuda/archive/11.1.0/cusparse/index.html

 

cuSPARSE :: CUDA Toolkit Documentation

X 1 , 1 X 1 , 2 ⋯ X 1 , n X 2 , 1 X 2 , 2 ⋯ X 2 , n ⋮ ⋮ ⋱ ⋮ X m , 1 X m , 2 ⋯ X m , n ⋮ ⋮ ⋱ ⋮ X l d X , 1 X l d X , 2 ⋯ X l d X , n

docs.nvidia.com

내가 지금 사용중이 cuda toolkit의 문서에 가보면 CUSPARSE_SPMV_ALG_DEFAULT는 검색을 해봐도 나오지 않는다. 따라서 문서에서 값을 CUSPARSE_SPMV_ALG_DEFAULT의 deprecated 버전인 CUSPARSE_MV_ALG_DEFAUL로 바꿔주고 다시 make를 진행시 문제 없이 진행됨을 확인할 수 있었다.