Skip to content
Snippets Groups Projects
Commit d486be26 authored by Xuan Gu's avatar Xuan Gu
Browse files

Update README.md

parent f700c02d
No related branches found
No related tags found
No related merge requests found
...@@ -40,11 +40,12 @@ This step is necessary for importing container images from [Nvidia NGC](https:// ...@@ -40,11 +40,12 @@ This step is necessary for importing container images from [Nvidia NGC](https://
- Complete step [4.1](https://docs.nvidia.com/ngc/ngc-overview/index.html#account-signup) and [4.3](https://docs.nvidia.com/ngc/ngc-overview/index.html#generating-api-key). Save the API key. - Complete step [4.1](https://docs.nvidia.com/ngc/ngc-overview/index.html#account-signup) and [4.3](https://docs.nvidia.com/ngc/ngc-overview/index.html#generating-api-key). Save the API key.
- Add the API key to the config file at ```~/.config/enroot/.credentials ``` - Add the API key by adding these lines to the config file at ```~/.config/enroot/.credentials ```
``` ```
machine nvcr.io login $oauthtoken password your_api_key machine nvcr.io login $oauthtoken password your_api_key
machine authn.nvidia.com login $oauthtoken password your_api_key machine authn.nvidia.com login $oauthtoken password your_api_key
``` ```
Please replace ```your_api_key``` with your real API key.
- Set the config path by adding the line to ```~/.bashrc``` - Set the config path by adding the line to ```~/.bashrc```
``` ```
...@@ -58,7 +59,7 @@ source ~/.bashrc ...@@ -58,7 +59,7 @@ source ~/.bashrc
## Set path to user container storage ## Set path to user container storage
By default, your enroot containers will be saved in your ```home``` directory. On Berzelius, you have 20 GB hard drive space for ```home```. It is a better practice to put enroot containers in your project directory. By default, your enroot containers will be saved in your ```home``` directory. On Berzelius, you have only 20 GB disk space for ```home```. It is a better practice to put enroot containers in your project directory.
Add this line to your ```bashrc``` Add this line to your ```bashrc```
...@@ -66,7 +67,10 @@ Add this line to your ```bashrc``` ...@@ -66,7 +67,10 @@ Add this line to your ```bashrc```
export ENROOT_CACHE_PATH=/proj/nsc_testing/xuan/enroot/cache export ENROOT_CACHE_PATH=/proj/nsc_testing/xuan/enroot/cache
export ENROOT_DATA_PATH=/proj/nsc_testing/xuan/enroot/data export ENROOT_DATA_PATH=/proj/nsc_testing/xuan/enroot/data
``` ```
To make the change valid
```
source ~/.bashrc
```
## Import container images ## Import container images
...@@ -88,7 +92,6 @@ For other versions, please see the Docker tags for [Pytorch](https://hub.docker. ...@@ -88,7 +92,6 @@ For other versions, please see the Docker tags for [Pytorch](https://hub.docker.
## Create a container ## Create a container
I will take Pytorch from Nvidia NGC for an example.
``` ```
enroot create --name nvidia_pytorch_22.09 nvidia+pytorch+22.09-py3.sqsh enroot create --name nvidia_pytorch_22.09 nvidia+pytorch+22.09-py3.sqsh
``` ```
...@@ -107,7 +110,7 @@ enroot start --rw --mount /proj/nsc_testing/xuan:/proj/nsc_testing/xuan nvidia_p ...@@ -107,7 +110,7 @@ enroot start --rw --mount /proj/nsc_testing/xuan:/proj/nsc_testing/xuan nvidia_p
The flag ```--mount``` mounts your local directory to your container. The flag ```--mount``` mounts your local directory to your container.
- You can also start a container and run your command at the same time. - You can also start a container and execute your command at the same time.
``` ```
enroot start --rw --mount /proj/nsc_testing/xuan:/proj/nsc_testing/xuan nvidia_pytorch_22.09 sh -c 'python path_to_your_script.py' enroot start --rw --mount /proj/nsc_testing/xuan:/proj/nsc_testing/xuan nvidia_pytorch_22.09 sh -c 'python path_to_your_script.py'
``` ```
...@@ -118,4 +121,4 @@ enroot start --rw --mount /proj/nsc_testing/xuan:/proj/nsc_testing/xuan nvidia_p ...@@ -118,4 +121,4 @@ enroot start --rw --mount /proj/nsc_testing/xuan:/proj/nsc_testing/xuan nvidia_p
enroot start --rw --env DISPLAY --mount /tmp/.X11-unix:/tmp/.X11-unix --mount /proj/nsc_testing/xuan:/proj/nsc_testing/xuan nvidia_pytorch_22.09 enroot start --rw --env DISPLAY --mount /tmp/.X11-unix:/tmp/.X11-unix --mount /proj/nsc_testing/xuan:/proj/nsc_testing/xuan nvidia_pytorch_22.09
``` ```
Please note that you need to use the flag ```-X``` when connecting to Berzelius. Please note that you need to use the flag ```-X``` to set up the X11 forwarding when connecting to Berzelius.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment