ubuntu安装cuda和cudnn

ubuntu使用apt安装nvidia驱动(参考:https://www.myfreax.com/how-to-nvidia-drivers-on-ubuntu-20-04/)
使用下边命令查看系统可以安装的驱动:

sudo add-apt-repository ppa:micahflee/ppa
sudo apt update

ubuntu-drivers devices

使用下边命令安装需要的驱动:

sudo apt install nvidia-driver-455

重启系统,查看是否安装成功

sudo reboot
nvidia-smi

关闭ubuntu桌面

systemctl isolate multi-user.target

安装驱动或者cuda

sudo sh cuda_11.8.0_520.61.05_linux.run

开启桌面

sudo systemctl start graphical.target

激活python环境

conda activate comfyui

安装torch(从这里获取安装命令:https://pytorch.org/get-started/locally/)

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

其他工具:
cuda下载:
https://developer.nvidia.com/cuda-toolkit-archive

cudnn下载:
https://developer.nvidia.com/rdp/cudnn-archive

为ubuntu系统终端使用代理

export https_proxy=http://192.168.88.253:10811 http_proxy=http://192.168.88.253:10811 all_proxy=socks5://192.168.88.253:10810
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。