Linux Ubuntu20.04深度学习环境快速配置命令记录

1、更新系统包

sudo apt-get update
 
sudo apt-get upgrade

2、安装显卡驱动

使用apt方式安装驱动,多数情况不容易成功,

使用一下方法更佳:

1.查看合适显卡的驱动版本

ubuntu-drivers devices

NVIDIA GeForce 驱动程序 - N 卡驱动 | NVIDIANVIDIA GeForce 驱动程序官方提供下载最新版的 Geforce 驱动程序,可提升 PC 游戏体验和应用程序速度。更多关于更新显卡驱动程序以及显卡驱动程序下载的信息,请访问 NVIDIA 官网。https://www.nvidia.cn/geforce/drivers/选择合适版本的驱动,下载后直接可以安装

下载推荐版本

两种方式:①有桌面的,直接双击进行安装。

②命令行:

sudo dpkg -i XXX.deb

2.minicoda 见前面的文章 。Miniconda --- conda documentationhttps://docs.conda.io/en/latest/miniconda.html#linux-installers

3、安装cuda

查看版本对应

CUDA 12.2 Release Notes --- cuda-toolkit-release-notes 12.2 documentationThe Release Notes for the CUDA Toolkit.https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html

查看pytorch版本对应

Previous PyTorch Versions | PyTorch An open source machine learning framework that accelerates the path from research prototyping to production deployment.https://pytorch.org/get-started/previous-versions/

安装 11.7版本cuda比较通用

CUDA Toolkit 11.7 Update 1 Downloads | NVIDIA DeveloperResources CUDA Documentation/Release NotesMacOS Tools Training Sample Code Forums Archive of Previous CUDA Releases FAQ Open Source PackagesSubmit a BugTarball and Zip Archive Deliverableshttps://developer.nvidia.com/cuda-11-7-1-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=20.04&target_type=deb_local

不要使用network版本安装,它会直接安装最新版本,使用离线安装,两个时间差不多

4、安装cudnn

cuDNN Archive | NVIDIA DeveloperExplore and download past releases from cuDNN GPU-accelerated primitive library for deep neural networks.https://developer.nvidia.com/rdp/cudnn-archive

主要对应版本,intel 选86_64 , 系统 20.04.只需要下载一个文件,这里和老版本不太一样。同样双击就可以安装。

最后一把配置环境变量

export PATH="/usr/local/cuda-11.7/bin${PATH:+:${PATH}}"
export LD_LIBRARY_PATH="/usr/local/cuda-11.7/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"

torch安装,参考18.04版本

Ubuntu 18.04 深度学习环境快速配置命令记录_瑾怀轩的博客-CSDN博客sudo apt-get install ubuntu-drivers-common #安装。4、在线安装不行,离线安装ok。5、安装miniconda。10、安装cudann。6、初始化conda。https://blog.csdn.net/ckq707718837/article/details/130884384?spm=1001.2014.3001.5502

相关推荐
韩楚风2 小时前
【linux 多进程并发】linux进程状态与生命周期各阶段转换,进程状态查看分析,助力高性能优化
linux·服务器·性能优化·架构·gnu
陈苏同学2 小时前
4. 将pycharm本地项目同步到(Linux)服务器上——深度学习·科研实践·从0到1
linux·服务器·ide·人工智能·python·深度学习·pycharm
Ambition_LAO2 小时前
解决:进入 WSL(Windows Subsystem for Linux)以及将 PyCharm 2024 连接到 WSL
linux·pycharm
Pythonliu72 小时前
茴香豆 + Qwen-7B-Chat-Int8
linux·运维·服务器
你疯了抱抱我2 小时前
【RockyLinux 9.4】安装 NVIDIA 驱动,改变分辨率,避坑版本。(CentOS 系列也能用)
linux·运维·centos
追风赶月、2 小时前
【Linux】进程地址空间(初步了解)
linux
栎栎学编程2 小时前
Linux中环境变量
linux
我是哈哈hh3 小时前
专题十_穷举vs暴搜vs深搜vs回溯vs剪枝_二叉树的深度优先搜索_算法专题详细总结
服务器·数据结构·c++·算法·机器学习·深度优先·剪枝
郭二哈3 小时前
C++——模板进阶、继承
java·服务器·c++
挥剑决浮云 -3 小时前
Linux 之 安装软件、GCC编译器、Linux 操作系统基础
linux·服务器·c语言·c++·经验分享·笔记