Skip to content

Instantly share code, notes, and snippets.

@lamhoangtung
Last active December 8, 2022 02:46
Show Gist options
  • Save lamhoangtung/d19bb72a99639a762b6d935fbd080c7c to your computer and use it in GitHub Desktop.
Save lamhoangtung/d19bb72a99639a762b6d935fbd080c7c to your computer and use it in GitHub Desktop.
How to install nvidia-docker offline for Ubuntu 18.04

How to install nvidia-docker offline for Ubuntu 18.04

Prerequisite

Before install nvidia-docker, you will need these first:

  • nvidia-driver
  • docker

Then download these file:

Instruction

Install them one by one:

sudo dpkg -i libnvidia-container1_1.3.0-1_amd64.deb
sudo dpkg -i libnvidia-container-tools_1.3.0-1_amd64.deb
sudo dpkg -i nvidia-container-toolkit_1.3.0-1_amd64.deb
sudo dpkg -i nvidia-container-runtime_3.4.0-1_amd64.deb
sudo dpkg -i nvidia-docker2_2.5.0-1_all.deb

Then restart docker:

sudo systemctl restart docker

And this should work now ;)):

sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi

Note

This same instruction can be apply for different Linux distribution and (or) arch. You just need to choose the suitable file.

@hiro-v
Copy link

hiro-v commented Dec 22, 2020

Hey there please check it out for the link you provide should be in AMD64, but the LINK is for ARM64. Thanks

@lamhoangtung
Copy link
Author

My bad. Fixed it @vuonghoainam

@hiro-v
Copy link

hiro-v commented Dec 22, 2020

Please update the docker offline installation with deb as nvidia-docker2_2.5.0-1_all.deb requires it to install URL

@lamhoangtung
Copy link
Author

I thought you already got docker installed :3

@hiro-v
Copy link

hiro-v commented Dec 22, 2020 via email

@hiro-v
Copy link

hiro-v commented Dec 30, 2020

Hey @lam,

I think you should add the nvidia cuda installation instruction to this one, as it will come with multiple incompatible dependencies
LINK

@lamhoangtung
Copy link
Author

@vuonghoainam please update offline docker installation

@hiro-v
Copy link

hiro-v commented Jan 4, 2021

Note:

If you need to install docker compose offline, please use as below:

1. Download cli file from [link](https://github.com/docker/compose/releases/download/1.27.4/docker-compose-Linux-x86_64) then copy locally
2. Copy to /usr/local/bin/docker-compose the downloaded file
3. sudo chmod +x /usr/local/bin/docker-compose
4. Run as normal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment