public:docker
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
public:docker [2025/02/22 11:58] – liang | public:docker [2025/02/23 23:03] (current) – [Step 4: Work with PyTorch] liang | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | Last-updated: | + | Last-updated: |
====== Docker tutorial ====== | ====== Docker tutorial ====== | ||
Line 5: | Line 5: | ||
===== Step 1: Understand docker ===== | ===== Step 1: Understand docker ===== | ||
- | * Read [[https:// | + | * Read https:// |
- | * Install docker (Linux as example. Information on other OSes are welcome too.) | + | * Install docker (Linux |
* $ sudo apt install docker.io | * $ sudo apt install docker.io | ||
- | * Add your username to the " | + | * Add your username to the " |
+ | * $ sudo usermod -aG docker your_username | ||
+ | * Logout & login to make the change of group into effect, or simply | ||
* Run a ubuntu container (docker client will automatically pull a ubuntu image and create a local container.). If you get a console with command prompt " | * Run a ubuntu container (docker client will automatically pull a ubuntu image and create a local container.). If you get a console with command prompt " | ||
* $ docker run -i -t ubuntu /bin/bash | * $ docker run -i -t ubuntu /bin/bash | ||
* Exit the container by exit (notice the prompt changed to "#", | * Exit the container by exit (notice the prompt changed to "#", | ||
- | * # exit | + | * # exit |
+ | |||
+ | ===== Step 2 (if you have an NVidia GPU): Install Nvidia GPU support ===== | ||
+ | |||
+ | * Follow https:// | ||
+ | |||
+ | ===== Step 3: Install PyTorch (for development) ===== | ||
+ | |||
+ | * $ docker pull pytorch/ | ||
+ | * $ docker run --rm --gpus all pytorch/ | ||
+ | * If you see " | ||
+ | |||
+ | ===== Step 4: Work with PyTorch ===== | ||
+ | |||
+ | * $ docker run -it --gpus all --rm pytorch/ | ||
+ | * # nvidia-smi | ||
+ | * If you see the use of your GPU, it worked. | ||
+ | |||
+ | ===== References ===== | ||
+ | |||
+ | * https:// | ||
public/docker.1740193106.txt.gz · Last modified: 2025/02/22 11:58 by liang