error: command ‘/usr/bin/nvcc‘ failed with exit status 1 报错--CUDA GCC Ubuntu版本匹配

error: command '/usr/bin/nvcc' failed with exit status 1如下图所示:

error: command ‘/usr/bin/nvcc‘ failed with exit status 1 报错--CUDA GCC Ubuntu版本匹配_第1张图片

原因:该错误是由于Gcc版本和CUDA版本不匹配所导致

通过nvcc -V 查看CUDA驱动版本

通过gcc -v 查看gcc版本

GCC与CUDA版本匹配关系:https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html

error: command ‘/usr/bin/nvcc‘ failed with exit status 1 报错--CUDA GCC Ubuntu版本匹配_第2张图片

点击右上角版本号的older,选择自己CUDA驱动的版本,再选择linux安装指导(Installation Guide linux)

error: command ‘/usr/bin/nvcc‘ failed with exit status 1 报错--CUDA GCC Ubuntu版本匹配_第3张图片

 

查看表格内内容,即为匹配内容:

error: command ‘/usr/bin/nvcc‘ failed with exit status 1 报错--CUDA GCC Ubuntu版本匹配_第4张图片

解决方法:调整GCC版本或者CUDA版本(建议调节GCC,方便快捷)

GCC版本调整方法:https://blog.csdn.net/qq_35781447/article/details/103302209

CUDA版本调整方法:https://blog.csdn.net/wanzhen4330/article/details/81704474?spm=1001.2014.3001.5501

 

你可能感兴趣的:(linux,环境设置,cuda,linux,GCC)