Skip to content

NVIDIA GPU Cloud setup and building NVIDIA Containers for Jetson and JetPack

Notifications You must be signed in to change notification settings

Rumeysakeskin/NGC-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 

Repository files navigation

NVIDIA GPU Cloud setup and building NVIDIA Containers for Jetson and JetPack

If you get below error when pulling docker image or running NVIDIA docker container:

ERROR: failed to solve: failed to fetch anonymous token: unexpected status: 401 Unauthorized

Follow next steps:

  1. Install NGC CLI

Follow steps from NVIDIA NGC CLI for your OS (Windows, AMD64 Linux, ARM64 Linux, ARM64 MacOs, Intel MacOs).

AMD64 Linux Install

The NGC CLI binary for Linux is supported on Ubuntu 16.04 and later distributions.

  • Click Download CLI to download the zip file that contains the binary, then transfer the zip file to a directory where you have permissions and then unzip and execute the binary. You can also download, unzip, and install from the command line by moving to a directory where you have execute permissions and then running the following command:
$ wget --content-disposition https://ngc.nvidia.com/downloads/ngccli_linux.zip && unzip ngccli_linux.zip && chmod u+x ngc-cli/ngc
  • Check the binary's md5 hash to ensure the file wasn't corrupted during download:
$ find ngc-cli/ -type f -exec md5sum {} + | LC_ALL=C sort | md5sum -c ngc-cli.md5
  • Add your current directory to path:
$ echo "export PATH=\"\$PATH:$(pwd)/ngc-cli\"" >> ~/.bash_profile && source ~/.bash_profile
  1. Setup Environment

  • Create an NVIDIA account and get your API Key.

  • Enter the following command, including your API key when prompted:

$ ngc config set

Enter API key [no-apikey]. Choices: [<VALID_APIKEY>, 'no-apikey']: 
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Enter CLI output format type [ascii]. Choices: [ascii, csv, json]: 
Enter org [no-org]. Choices: ['xxxxxxxxxxxx']: xxxxxxxxxxxx
Enter team [no-team]. Choices: ['no-team']: no-team
Successfully saved NGC configuration to /root/.ngc/config
  • Check your Docker configuration: Verify that your Docker configuration is updated to include the appropriate registry authentication information. You can do this by checking your ~/.docker/config.json file.

  • Check your NGC version:

$ ngc --version

NGC CLI 3.21.0
  • Login to registry: For the username, enter '$oauthtoken' exactly as shown. It is a special authentication token for all users.
$ docker login nvcr.io

Username: $oauthtoken
Password: <Your Key>
  1. Create Dockerfile

To create your own container, choose a suitable PyTorch container version from NVIDIA PyTorch Container Versions.

For example my machine specifications: cuda:11.6.2 and ubuntu:20.04. I have to use nvidia container: 22.04.

FROM nvcr.io/nvidia/pytorch:22.04-py3
WORKDIR /working/directory/ 
COPY requirements.txt .
RUN pip install -r requirements.txt

For example our specifications: JetPack 4.6.1, L4T 32.7.1

FROM nvcr.io/nvidia/l4t-ml:r32.7.1-py3 
WORKDIR /working/directory/ 
COPY requirements.txt .
RUN pip install -r requirements.txt
  1. Build Docker

docker build --no-cache -t project_name .
  1. Run Docker

docker run -it --rm --gpus all -v working/directory/ :working/directory/  project_name

About

NVIDIA GPU Cloud setup and building NVIDIA Containers for Jetson and JetPack

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published