在 ubuntu 20.04 上运行 CUDA 示例时出现错误

在 ubuntu 20.04 上运行 CUDA 示例时出现错误

我在 ubuntu 20.04 上安装了 Cuda 10.4 工具包和 Cudnn。Nvidia-smi 显示 CUDA 版本为 11.4。但是,nvcc -V 命令输出未找到。

当我运行 cuda 示例时,收到以下消息:

$ cp -r /usr/src/cudnn_samples_v8/ $HOME
$ cd  $HOME/cudnn_samples_v8/mnistCUDNN
$ make clean && make
rm -rf *o
rm -rf mnistCUDNN
cat: /usr/local/cuda/include/cuda.h: No such file or directory
CUDA_VERSION is
/bin/sh: 1: test: -ge: unexpected operator
Linking agains cublasLt = false
expr: syntax error: unexpected argument ‘11000’
expr: syntax error: unexpected argument ‘11010’
CUDA VERSION:
TARGET ARCH: x86_64
HOST_ARCH: x86_64
TARGET OS: linux
SMS: 35 50 53 60 61 62 70
/bin/sh: 1: /usr/local/cuda/bin/nvcc: not found
>>> WARNING - FreeImage is not set up correctly. Please ensure FreeImage is set up correctly. <<<
[@] /usr/local/cuda/bin/nvcc -I/usr/local/cuda/include -I/usr/local/cuda/include -IFreeImage/include -ccbin g++ -m64 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_53,code=sm_53 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_62,code=sm_62 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_70,code=compute_70 -o fp16_dev.o -c fp16_dev.cu
[@] g++ -I/usr/local/cuda/include -I/usr/local/cuda/include -IFreeImage/include -o fp16_emu.o -c fp16_emu.cpp
[@] g++ -I/usr/local/cuda/include -I/usr/local/cuda/include -IFreeImage/include -o mnistCUDNN.o -c mnistCUDNN.cpp
[@] /usr/local/cuda/bin/nvcc -ccbin g++ -m64 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_53,code=sm_53 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_62,code=sm_62 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_70,code=compute_70 -o mnistCUDNN fp16_dev.o fp16_emu.o mnistCUDNN.o -I/usr/local/cuda/include -I/usr/local/cuda/include -IFreeImage/include -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib64 -LFreeImage/lib/linux/x86_64 -LFreeImage/lib/linux -lcudart -lcublas -lcudnn -lfreeimage -lstdc++ -lm
$ ./mnistCUDNN
-sh: 8: ./mnistCUDNN: not found

相关内容