amgcl
amgcl copied to clipboard
Errors Compiling Examples with CUDA Backend (Nvidia Geforce GTX 2080 Ti, Cuda 12.0)
Hi Demidov, Thanks for this awesome repo, I was trying to build the examples with Cuda backend, in the root directory with command
cmake -DCMAKE_BUILD_TYPE=Release -DAMGCL_BUILD_TESTS=ON -DAMGCL_BUILD_EXAMPLES=ON
make
and got the following error:
...
[ 49%] Building NVCC (Device) object examples/CMakeFiles/solver_cuda.dir/solver_cuda_generated_solver.cu.o
nvcc fatal : Unsupported gpu architecture 'compute_30'
CMake Error at solver_cuda_generated_solver.cu.o.Release.cmake:220 (message):
Error generating
.../amgcl-1.4.3/examples/CMakeFiles/solver_cuda.dir//./solver_cuda_generated_solver.cu.o
make[2]: *** [examples/CMakeFiles/solver_cuda.dir/build.make:77: examples/CMakeFiles/solver_cuda.dir/solver_cuda_generated_solver.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1243: examples/CMakeFiles/solver_cuda.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
As a reference, I am compiling the latest amgcl (version 1.4.3) on the ubuntu 20.04 platform with a Geforce 2080 Ti GPU, the installed Nvidia driver version is 525.85.12 (Cuda version 12.0). Do you have any ideas on this error? Thanks:)
If you look up "Geforce 2080 Ti architecture", it yields "Turing". So I would try to configure amgcl with (the option is defined here):
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DAMGCL_BUILD_TESTS=ON \
-DAMGCL_BUILD_EXAMPLES=ON \
-DCUDA_TARGET_ARCH="Turing"
Hi mate, thanks for your swift response, I am running into another weird error that says that the libcusparse stuff is undefined, though I have checked the CMakeLists.txt and I'm sure it is linked to the targets properly:( Again, any idea on this issue is greatly appreciated:)
[ 49%] Building NVCC (Device) object examples/CMakeFiles/solver_cuda.dir/solver_cuda_generated_solver.cu.o
.../amgcl-1.4.3/amgcl/backend/cuda.hpp(123): error: identifier "csrsv2Info_t" is undefined
.../amgcl-1.4.3/amgcl/backend/cuda.hpp(124): error: identifier "cusparseDestroyCsrsv2Info" is undefined
.../amgcl-1.4.3/amgcl/backend/cuda.hpp(161): error: identifier "CUSPARSE_ALG_MERGE_PATH" is undefined
.../amgcl-1.4.3/amgcl/relaxation/cusparse_ilu0.hpp(278): error: identifier "csrsv2Info_t" is undefined
.../amgcl-1.4.3/amgcl/relaxation/cusparse_ilu0.hpp(278): error: nontype "std::remove_pointer<_Tp>::type [with _Tp=<error-type>]" is not a type name
.../amgcl-1.4.3/amgcl/relaxation/cusparse_ilu0.hpp(363): error: identifier "csrsv2Info_t" is undefined
.../amgcl-1.4.3/amgcl/relaxation/cusparse_ilu0.hpp(381): error: identifier "csrsv2Info_t" is undefined
.../amgcl-1.4.3/amgcl/relaxation/cusparse_ilu0.hpp(435): error: identifier "csrsv2Info_t" is undefined
.../amgcl-1.4.3/amgcl/relaxation/cusparse_ilu0.hpp(454): error: identifier "csrsv2Info_t" is undefined
.../amgcl-1.4.3/amgcl/relaxation/cusparse_ilu0.hpp(508): error: identifier "csrsv2Info_t" is undefined
.../amgcl-1.4.3/amgcl/relaxation/cusparse_ilu0.hpp(531): error: identifier "csrsv2Info_t" is undefined
.../amgcl-1.4.3/amgcl/relaxation/cusparse_ilu0.hpp(120): error: identifier "csrsv2Info_t" is undefined
.../amgcl-1.4.3/amgcl/relaxation/cusparse_ilu0.hpp(121): error: identifier "cusparseCreateCsrsv2Info" is undefined
.../amgcl-1.4.3/amgcl/relaxation/cusparse_ilu0.hpp(125): error: identifier "csrsv2Info_t" is undefined
.../amgcl-1.4.3/amgcl/relaxation/cusparse_ilu0.hpp(126): error: identifier "cusparseCreateCsrsv2Info" is undefined
.../amgcl-1.4.3/amgcl/relaxation/cusparse_ilu0.hpp(367): error: identifier "cusparseDcsrsv2_bufferSize" is undefined
.../amgcl-1.4.3/amgcl/relaxation/cusparse_ilu0.hpp(385): error: identifier "cusparseScsrsv2_bufferSize" is undefined
.../amgcl-1.4.3/amgcl/relaxation/cusparse_ilu0.hpp(440): error: identifier "cusparseDcsrsv2_analysis" is undefined
.../amgcl-1.4.3/amgcl/relaxation/cusparse_ilu0.hpp(459): error: identifier "cusparseScsrsv2_analysis" is undefined
.../amgcl-1.4.3/amgcl/relaxation/cusparse_ilu0.hpp(515): error: identifier "cusparseDcsrsv2_solve" is undefined
.../amgcl-1.4.3/amgcl/relaxation/cusparse_ilu0.hpp(538): error: identifier "cusparseScsrsv2_solve" is undefined
21 errors detected in the compilation of ".../amgcl-1.4.3/build/examples/solver.cu".
CMake Error at solver_cuda_generated_solver.cu.o.Release.cmake:280 (message):
Error generating file
.../amgcl-1.4.3/build/examples/CMakeFiles/solver_cuda.dir//./solver_cuda_generated_solver.cu.o
make[2]: *** [examples/CMakeFiles/solver_cuda.dir/build.make:77: examples/CMakeFiles/solver_cuda.dir/solver_cuda_generated_solver.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1243: examples/CMakeFiles/solver_cuda.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
I see a bunch of deprecation warnings when compiling with cuda-11. It is possible those got finally removed in cuda-12. I'll need to look at these some time soon. In the meanwhile, I guess the only option for you is to use cuda-11.
You could also try to use vexcl backend with cuda (make solver_vexcl_cuda).
Thanks, man, I'll try vexcl cuda then.
@AXIHIXA , could you please check if #250 solves the compilation issues with CUDA 12?