Search code examples
makefilecudacublas

nvidia simpleDevLibCUBLAS error


My goal is to insert a cublas process in my cuda kernel so i looked at simpleDevLibCUBLAS example.

My compilation leads to that:

/usr/lib/nvidia-cuda-toolkit/bin/nvcc -ccbin g++   -m64      -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_52,code=compute_52 -o simpleDevLibCUBLAS kernels.o simpleDevLibCUBLAS.o  -lcublas -lcublas_device -lcudadevrt

nvlink error : Undefined reference to 'cublasCreate_v2' in 'kernels.o' (target: sm_35) nvlink error : Undefined reference to 'cublasSgemm_v2' in 'kernels.o' (target: sm_35) nvlink error : Undefined reference to 'cublasDestroy_v2' in 'kernels.o' (target: sm_35) Makefile:239 : la recette pour la cible « simpleDevLibCUBLAS » a échouée make: *** [simpleDevLibCUBLAS] Erreur 255

I try to modify the Makefile but nothing works.

Can somehone give me a tips?


Solution

  • It looks like your linker does not know where to find the libraries specified by -lcublas -lcublas_device -lcudadevrt

    You could tell it with the link option -L/path/to/cuda/libs