Set Up and Configure Your Azure Account
- Ensure you have an active Microsoft Azure account. You can sign up at the Azure website if you don't have one.
- Access the Azure portal by navigating to https://portal.azure.com/.
- In the Azure portal, ensure you have sufficient permissions to create resources and manage virtual networks.
Install Azure CLI
- Download and install the Azure CLI from here.
- After installation, open a terminal or command prompt and login using your Azure credentials:
az login
Register NVIDIA GPU Cloud (NGC)
- Create an NVIDIA NGC account at NGC Signup.
- After registration, verify your email and login to the NGC website.
- Navigate to the 'API Key' section under your account settings. Generate and save this API key for accessing NGC resources.
Create an Azure Resource Group
- In the Azure portal or using the CLI, create a new resource group to organize your NVIDIA GPU Cloud resources:
az group create --name myResourceGroup --location eastus
Deploy NVIDIA GPU-Optimized VM
- Use the Azure Marketplace to search for NVIDIA GPU-optimized VMs or use the CLI to deploy a Deep Learning VM.
- Run the following command to create a VM instance with an NVIDIA GPU:
az vm create \
--resource-group myResourceGroup \
--name myNvidiaVM \
--image microsoft-dsvm:ubuntu-hvm:ubuntu-1804:latest \
--size Standard_NC6
Install NVIDIA Drivers and Docker on Azure VM
- SSH into the VM once it's running:
ssh azureuser@your-vm-ip-address
- Update the package list and install the NVIDIA driver:
sudo apt-get update
cuda-drivers
sudo apt-get install docker.io
sudo systemctl start docker
sudo systemctl enable docker
Configure Docker for NVIDIA GPU Support
- Install the NVIDIA Docker container runtime:
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update
sudo apt-get install -y nvidia-docker2
sudo systemctl restart docker
- Verify the installation using the NVIDIA Docker tool:
sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi
Access NVIDIA GPU Cloud CLI
- Install the NGC CLI tool:
wget -O ngccli_cat_linux.zip https://ngc.nvidia.com/downloads/ngccli_cat_linux.zip && unzip ngccli_cat_linux.zip && rm ngccli_cat_linux.zip
- Configure the NGC CLI with your API key obtained from the NGC website:
ngc config set
- Enter your API key and set the default storage to Azure.
Pull and Run NVIDIA Docker Container
- Use the NGC CLI to pull a Docker container with the desired framework:
ngc registry image pull nvcr.io/nvidia/tensorflow:21.03-tf1-py3
- Run the pulled Docker container on your VM:
sudo docker run --gpus all -it nvcr.io/nvidia/tensorflow:21.03-tf1-py3