[管理员手册](五)Ubuntu desktop 20.04系统安装显卡驱动NVIDIA& cuda &pytorch&向日葵sunlogin安装

此命令需慎重!!!sudo apt upgrade 内核更新!!!显卡驱动可能需要重装!

1、首先需要彻底删除已有驱动
sudo apt-get remove --purge '^nvidia-.*'
sudo apt-get install ubuntu-desktop
sudo rm /etc/X11/xorg.conf
echo 'nouveau' | sudo tee -a /etc/modules
 

2、安装驱动
ubuntu-drivers devices
sudo ubuntu-drivers autoinstall
或sudo apt install nvidia-driver-xxx
reboot 后测试命令nvidia-smi查看是否安装成功
如果出现Failed to initialize NVML: driver/library version mismatch 表明内核模块(cat /proc/driver/nvidia/version) 和新安装的驱动(可能是自动更新的)不匹配。试验了两种方法[7][8],都不能将内核卸载,因此保持与内核一致的驱动版本进行安装。

3、安装深度学习套件cuda pytorch
sudo apt install nvidia-cuda-toolkit
登录https://pytorch.org/ 进行安装设定 安装pytorch:pip install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html

4、解决向日葵软件在Ubuntu 20.04依赖libwebkitgtk-3.0-0等问题[9][10]
1)下载向日葵软件 SunloginClient-10.0.2.24779_amd64.deb
2)修改并重新打包https://www.jianshu.com/p/289001a00cb1,安装
3)向日葵在系统中作为服务存在,/etc/systemd/system/runsunloginclient.service  同时也存在于多用户模式/etc/systemd/system/multi-user.target.wants/runsunloginclient.service   配置文件存在于/etc/orayconfig.conf
4)启动向日葵后在home下自动建立sensors文件夹,没有很好的办法处理,故在启动脚本/usr/local/sunlogin/etc/watch.sh中  添加命令rm -rf sensors

[1]How can I uninstall a nvidia driver completely ?https://askubuntu.com/questions/206283/how-can-i-uninstall-a-nvidia-driver-completely
[2]How to install the NVIDIA drivers on Ubuntu 18.04 Bionic Beaver Linux https://linuxconfig.org/how-to-install-the-nvidia-drivers-on-ubuntu-18-04-bionic-beaver-linux
[3]Pytorch如何更新版本与卸载,使用pip,conda更新卸载Pytorch https://blog.csdn.net/miao0967020148/article/details/80400357
[4]NVIDIA CUDA Installation Guide for Linux https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html
[5]NVIDIA cudnn Installation Guide for Linuxhttps://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html#installlinux
[6]显卡,显卡驱动,nvcc, cuda driver,cudatoolkit,cudnn到底是什么?https://www.cnblogs.com/marsggbo/p/11838823.html
[7]NVIDIA驱动问题解决方案:Failed to initialize NVML: driver/library version mismatch https://my.oschina.net/wangsifangyuan/blog/1606093
[8]解决Driver/library version mismatch https://comzyh.com/blog/archives/967/
[9]解决向日葵软件在Ubuntu 20.04依赖libwebkitgtk-3.0-0等问题https://www.jianshu.com/p/289001a00cb1
[10]Ubuntu20.04安装向日葵远程控制软件https://zhuanlan.zhihu.com/p/144426017



  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值