首页 > 矩池云上如何安装nvcc
头像
矩池云
发布于 2020-12-10 09:53
+ 关注

矩池云上如何安装nvcc

若您想要使用 nvcc,但是所选的镜像中没有预装 nvcc,可按照如下操作自行安装。

1、检查系统版本

source /etc/os-release && echo $VERSION_ID

2、导入apt仓库和其GPG key

# 第一步若输出 16.04 
curl -fsSL [https://mirrors.aliyun.com/nvidia-cuda/ubuntu1604/x86_64/7fa2af80.pub](https://mirrors.aliyun.com/nvidia-cuda/ubuntu1604/x86_64/7fa2af80.pub) | apt-key add -
echo "deb [https://mirrors.aliyun.com/nvidia-cuda/ubuntu1604/x86_64/](https://mirrors.aliyun.com/nvidia-cuda/ubuntu1604/x86_64/) /" > /etc/apt/sources.list.d/cuda.list

# 第一步若输出 18.04 
curl -fsSL [https://mirrors.aliyun.com/nvidia-cuda/ubuntu1804/x86_64/7fa2af80.pub](https://mirrors.aliyun.com/nvidia-cuda/ubuntu1804/x86_64/7fa2af80.pub) | apt-key add -
echo "deb [https://mirrors.aliyun.com/nvidia-cuda/ubuntu1804/x86_64/](https://mirrors.aliyun.com/nvidia-cuda/ubuntu1804/x86_64/) /" > /etc/apt/sources.list.d/cuda.list

3、安装所需版本的 nvcc

apt update
# "10-0" 表示安装CUDA10.0版本的 nvcc, 应根据镜像中cuda版本安装
apt install cuda-command-line-tools-10-0

cuda10的镜像ubuntu1804

apt update
apt install cuda-command-line-tools-10-0

cuda10.1的镜像ubuntu1804

apt update
apt install cuda-command-line-tools-10-1

cuda10.2的镜像ubuntu1804

apt update
apt install cuda-command-line-tools-10-2

cuda9的镜像ubuntu1604

apt update
apt install cuda-command-line-tools-9-0

cuda8的镜像ubuntu1604

apt update
apt install cuda-command-line-tools-8-0

4、验证nvcc安装

nvcc --version

参考链接

https://mirrors.aliyun.com/nvidia-cuda/ubuntu1804/x86_64/

https://mirrors.aliyun.com/nvidia-cuda/ubuntu1604/x86_64/

全部评论

(0) 回帖
加载中...
话题 回帖

推荐话题

相关热帖

近期热帖

近期精华帖

热门推荐