Install GPU nvidia-docker2 on CentOS 8
2023. 1. 5. 09:52ㆍLinux/docker
728x90
SMALL
- 개요
CentOS에 nvidia-docker2를 설치하는 과정은 의존성 및 버전 정합성 이슈로 상당히 까다롭다
- 방법
sudo yum config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
sudo yum erase podman buildah
sudo yum install docker-ce
sudo systemctl start docker
sudo systemctl enable docker
sudo curl -L https://github.com/docker/compose/releases/download/v2.14.2/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
docker-compose version
sudo dnf install -y tar bzip2 make automake gcc gcc-c++ pciutils elfutils-libelf-devel libglvnd-devel
distribution=rhel8
ARCH=$( /bin/arch )
sudo dnf config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/$distribution/${ARCH}/cuda-$distribution.repo
sudo dnf install -y kernel-devel-$(uname -r) kernel-headers-$(uname -r)
sudo dnf install -y kernel kernel-core kernel-modules
sudo dnf -y module install nvidia-driver:latest-dkms
curl https://nvidia.github.io/nvidia-docker/centos8/nvidia-docker.repo > /etc/yum.repos.d/nvidia-docker.repo
dnf -y install nvidia-container-toolkit
mkdir -p /usr/share/keyrings/
touch /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list
yum -y install http://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-repo-rhel8-10.2.89-1.x86_64.rpm
modprobe -r nouveau
yum -y install cuda
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.repo | > sudo tee /etc/yum.repos.d/nvidia-docker.repo
yum install nvidia-docker2
reboot
docker run --rm --gpus all nvidia/cuda:11.6.2-base-ubuntu20.04 nvidia-smi
- reference
https://github.com/docker/compose/releases
https://nvidia.github.io/nvidia-docker/
https://developer.nvidia.com/blog/streamlining-nvidia-driver-deployment-on-rhel-8-with-modularity-streams/
https://docs.nvidia.com/datacenter/tesla/tesla-installation-notes/index.html#centos8
https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions
https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html
https://www.ibm.com/docs/en/maximo-vi/8.3.0?topic=planning-installing-docker-nvidia-docker2
728x90
LIST
'Linux > docker' 카테고리의 다른 글
WARNING! Using --password via the CLI is insecure. Use --password-stdin. (0) | 2023.09.19 |
---|---|
Sending build context to Docker daemon 오래 걸릴 경우 (0) | 2023.06.30 |
docker cache 삭제 (1) | 2023.01.17 |
CentOS 8 docker-ce 및 docker compose 설치 (1) | 2023.01.04 |
changing docker data root directory (0) | 2022.10.11 |