The use of graphical processing units (GPUs) rapidly improves the processing time for machine learning models. ArcGIS Notebook Server can take advantage of NVIDIA GPUs on its host machine once some additional steps are performed.
Starting at 10.8, the built-in ArcGIS Notebook Server runtimes include the Conda CUDA Toolkit to enable GPU support. Previously, this workflow required building a custom runtime to include CUDA.
The following workflow has two primary goals. The first is to install NVIDIA drivers and runtime, which will allow your site's Docker component to build GPU-ready containers. The second is to create a copy of the Advanced notebook runtime that's configured to use the NVIDIA runtime. All ArcGIS Notebooks opened using this runtime will launch in GPU-ready containers. Aside from that, the new runtime will keep all the Python libraries of the Advanced notebook runtime.
Once ArcGIS Notebook Server has been installed and configured, follow these steps. If your ArcGIS Notebook Server site has multiple machines, follow steps 1 through 3 on all machines.
- Install the appropriate NVIDIA drivers on each machine in your site. See the NVIDIA website for complete information.
- Install the nvidia-docker 2.0 runtime on the machine so that notebook containers can take advantage of GPUs. Refer to the NVIDIA-Docker repository on GitHub for the downloads and documentation pertaining to your specific OS.
- Run the following command on each machine to ensure that your NVIDIA elements are properly installed:
docker run --runtime=nvidia --rm nvidia/cuda:9.0-base nvidia-smi
- Sign in to your ArcGIS Enterprise portal as an administrator and open ArcGIS Notebook Server Manager.
- Open the Settings page, and click Runtimes.
- Click the Edit icon for the runtime labeled ArcGIS Notebook Python 3 Advanced. Copy the value given for its Image ID. Click Cancel to exit the editor.
- From the Runtimes page, click Register Runtime.
- On the Register Runtime page, provide an appropriate name (such as GPU Runtime) and give the version as 10.9. For the Image ID value, add the value you copied in step 5.
- Set the Docker Runtime value to be nvidia. Click Register Runtime to confirm.
- Verify you have successfully configured ArcGIS Notebook Server to use NVIDIA GPUs. As a portal member with the Advanced Notebooks privilege, create a new blank notebook. When you specify the runtime of the notebook, select your new GPU-ready runtime. Copy the following into a notebook cell and run the cell.
The output returns as True, because the torch.cuda package requires GPUs to run.
import torch torch.cuda.is_available()
- Run the following command in a new cell to view your machine's GPU configuration:
If you want to remove the capacity for your site to use GPUs, open the Runtimes page in ArcGIS Notebook Server Manager and delete the runtime you created in this workflow.