deepinV23 Beta3安装cuda


deepinV23 Beta3对应的debian版本是12:
在这里插入图片描述
bookworm指的是debian12, sid代表不稳定版。

下载CUDA

官网:https://developer.nvidia.com/cuda-toolkit-archive

方法1:下载支持debian12的CUDA版本,如CUDA12.3。

方法2:下载不支持debian12的CUDA版本,如CUDA11.6,下载.run文件(runfile)。
示例:

wget https://developer.download.nvidia.com/compute/cuda/11.6.2/local_installers/cuda_11.6.2_510.47.03_linux.run

安装,以cuda11.6为例

运行.run文件

安装cuda11.6,实际上是由于gcc版本不支持,导致安装失败;要使用参数--override,才能成功安装。

sudo sh cuda_11.6.2_510.47.03_linux.run --override

vim查看文件/var/log/cuda-installer.log
报错[ERROR] GCC版本不兼容,要是想忽略这个问题,请使用--override参数

/var/log/cuda-installer.log日志文件:

[INFO]: Driver not installed.
[INFO]: Checking compiler version...
[INFO]: gcc location: /usr/bin/gcc
                               
[INFO]: gcc version: gcc version 13.2.0 (Deepin 13.2.0-3deepin)
                                                    
[ERROR]: unsupported compiler version: 13.2.0. Use --override to override this check. 

安装选项

输入accept,enter回车
在这里插入图片描述
已经安装好Nvidia显卡驱动了,就取消安装Driver,将X号改为空,选择Install,enter回车
在这里插入图片描述
安装完成,输出的提示信息,要配置环境变量,PATH 和 LD_LIBRARY_PATH

jyu@jyu-PC:~/Downloads$ sudo sh cuda_11.6.2_510.47.03_linux.run --override
===========
= Summary =
===========

Driver:   Not Selected
Toolkit:  Installed in /usr/local/cuda-11.6/

Please make sure that
 -   PATH includes /usr/local/cuda-11.6/bin
 -   LD_LIBRARY_PATH includes /usr/local/cuda-11.6/lib64, or, add /usr/local/cuda-11.6/lib64 to /etc/ld.so.conf and run ldconfig as root

To uninstall the CUDA Toolkit, run cuda-uninstaller in /usr/local/cuda-11.6/bin
***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 510.00 is required for CUDA 11.6 functionality to work.
To install the driver using this installer, run the following command, replacing <CudaInstaller> with the name of this run file:
    sudo <CudaInstaller>.run --silent --driver

Logfile is /var/log/cuda-installer.log
jyu@jyu-PC:~/Downloads$

配置环境变量

配置环境变量的方法,有多种,以用户目录下的~/.bashrc为例。
编辑~/.bashrc文件

# 推荐
vim ~/.bashrc

在最下面输入:

export PATH=$PATH:/usr/local/cuda-11.6/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.6/lib64

:wq保存退出

使环境变量临时生效

source ~/.bashrc

查看cuda版本

# 不配置环境变量,系统找不到nvcc命令
nvcc -V
或
nvcc --version

在这里插入图片描述
查看cuda版本的其他方法:

# 不同系统不一样,有的是version.json,有的是version.txt
cat /usr/local/cuda/version.json
cat /usr/local/cuda/version.txt

/usr/local/cuda是/usr/local/cuda-11.6的软链接
在这里插入图片描述

重启计算机

重启计算机,使环境变量永久生效。
deepinV23 Beta3 不需要重启计算机,每次打开新的shell都会读取~/.bashrc文件。

卸载cuda

ubuntu 完全卸载CUDA
此文章也适用于deepin。

  • 3
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值