linux装机记录

Ubuntu22.04 装机记录

apt代理

sudo touch /etc/apt/apt.confg
echo "Acquire::http::Proxy "http://10.0.5.66:3128";" >> /etc/apt/apt.confg

安装显卡驱动

Desktop

runfile 安装地址:https://www.nvidia.com/Download/Find.aspx?lang=en-us
系统安装
Software & Update
在这里插入图片描述
选择合适的驱动 - apply changes - reboot

这种安装方式会自动禁用Nouveau服务无需手动添加黑名单

Server

搜索驱动

sudo apt search nvidia-driver

系统驱动推荐

ubuntu-drivers devices

通过apt安装

sudo apt install nvidia-driver-535-server

安装Nvidia-Toolkit

  1. 下载nvidia-toolkit
  2. 根据自己的系统选择响应的安装包
  3. 安装
  4. 配置环境变量
sudo ./cuda_12.2.2_535.104.05_linux.run
sudo vim /etc/profile.d/cuda-config.sh
# 放置一下内容
export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

安装cudnn

下载地址
历史下载存档
历史文档存档

安装步骤

前置条件
  • Installing NVIDIA Graphics Drivers
  • Installing the CUDA Toolkit
  • for Linux Installing Zlib
cudnn和CUDA Toolkit、Driver兼容查询
Package Manager 安装方式
  • apt
  • deb
Tarball 安装方式
# decompress
tar -xvf cudnn-linux-x86_64-8.9.7.29_cuda12-archive.tar.xz
# copy 
sudo cp cudnn-*-archive/include/cudnn*.h /usr/local/cuda/include 
sudo cp -P cudnn-*-archive/lib/libcudnn* /usr/local/cuda/lib64 
sudo chmod a+r /usr/local/cuda/include/cudnn*.h /usr/local/cuda/lib64/libcudnn*

安装docker

Engine 安装:

  1. 地址:https://docs.docker.com/engine/install/ubuntu/#Installation%20methods
  2. 免sudo调用方式:https://docs.docker.com/engine/install/linux-postinstall/

docker hub 代理

sudo vim /etc/docker/daemon.json
# add this 
{
    "proxies": {
       "http-proxy": "http://10.0.5.66:3128",
       "https-proxy": "http://10.0.5.66:3128",
       "no-proxy": "*.test.example.com,.example.org,127.0.0.0/8"
  }

容器内代理

目录不存在需要手动创建

vim .docker/config.json
{
	"proxies": {
  		"default": {
     			"httpProxy": "http://10.0.5.66:3128",
     			"httpsProxy": "http://10.0.5.66:3128",
     			"noProxy": "*.test.example.com,.example.org,127.0.0.0/8"
   		}
 	}
}

NVIDIA Container Toolkit安装

安装容器工具
  • https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html
配置使用gpu启动容器
  • https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#configuration

安装Pytorch

pip安装

  • https://pytorch.org/get-started/previous-versions/

安装Opencv

pip安装

包含GUI版本
  1. pip install --user opencv-python
  2. pip install --user opencv-contrib-python
服务器版本(阉割了gui等)
  1. pip install opencv-python-headless

Onnxruntime

  • https://onnxruntime.ai/docs/install/
安装NCCL2

Ubuntu22.04 无法直接从apt中安装nccl库

  1. 文档页:https://docs.nvidia.com/deeplearning/nccl/install-guide/index.html

  2. 下载页:https://developer.nvidia.com/nccl

  3. 选择自己需要的版本进行下载

    • 目前测试Local installers 的方式导入的deb仓库无法直接下载,选用Network installers (x86)安装方式,根据自己的系统选择
  4. sudo apt update

  5. then run the following command to installer NCCL:

    Note: If you are using the network repository, the following command will upgrade CUDA to the latest version.
    sudo apt install libnccl2 libnccl-dev

    安装指定版本:

    • For Ubuntu: sudo apt install libnccl2=2.14.3-1+cuda11.7 libnccl-dev=2.14.3-1+cuda11.7
    • For RHEL/Centos: sudo yum install libnccl-2.14.3-1+cuda11.7 libnccl-devel-2.14.3-1+cuda11.7 libnccl-static-2.14.3-1+cuda11.7
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值