Prerequisites
- Begin with Docker-supported operating system
- Install Docker - minimum version: 23.0.1
- Install NVIDIA Drivers - minimum version: 590.44.01
- Install the NVIDIA Container Toolkit - minimum version: 1.13.5
- Verify your container runtime supports NVIDIA GPUs by running
Example output:
For more information on enumerating multi-GPU systems, please see the NVIDIA Container Toolkit’s GPU Enumeration Docs
NGC (NVIDIA GPU Cloud) Account
-
Export your NGC API key so the following commands can reference it (replace
<Enter your NGC key here>with the key from step 2): -
Docker log in with your NGC API key:
NGC CLI Tool
- Download the NGC CLI tool for your OS.
Use NGC CLI version
3.41.1or newer. Here is the command to install this on AMD64 Linux in your home directory:
- Set up your NGC CLI Tool locally (You’ll need your API key for this!):
After you enter your API key, you may see multiple options for the org and team. Select as desired or hit enter to accept the default.
- Log in to NGC
You’ll need log in to NGC via Docker and set the NGC_API_KEY environment variable to pull images:
Then, set the relevant environment variables in your shell. You will need to set the NGC_API_KEY variable:
- Set up your NIM cache
The NIM cache allows you to download models and store previously-downloaded models so that you don’t need to download them again later when you run the NIM again. The NIM cache must be readable and writable by the NIM, so in addition to creating the directory, the permissions on this directory need to be set to globally readable writable. The NIM cache directory can be set up as follows:
Now, you should be able to pull the container and download the model using the environment variables. To get started, see the quickstart guide.
Running on Slurm With Enroot
This section describes how to run the OpenFold2 NIM on a Slurm-based HPC cluster using Enroot to run the NGC container.
NGC_API_KEY: You must export your NGC API key before running the Slurm script so that Enroot can pull the image from NGC. Then run the script (for example, bash openfold2_srun.sh).
Example:
Environment
- Enroot: Version 3.4.1 or newer is supported.
1. Check Enroot is Available
On the login node, verify Enroot is installed:
If Enroot is not installed, contact your cluster administrator. Typical path: /usr/bin/enroot.
Create the Enroot config directory if it does not exist:
2. Create and Add NGC Credentials
Create the credentials file so Enroot can pull images from NGC. Replace YOUR_NGC_API_KEY with your NGC API key:
Restrict permissions and confirm the file content:
Note: Use vi ~/.config/enroot/.credentials or another editor if you prefer not to echo the key on the command line.
3. Configure and Run the Slurm Job Script
Copy the script below to a file, such as openfold2_srun.sh. Set the variables at the top for your cluster and paths:
- ACCOUNT: Slurm account name
- PARTITION: Slurm partition (for example,
interactiveorgpu) - ROOT_DIR: Your working directory on the cluster (for example, Lustre or NFS path)
- NGC_IMAGE: NGC image with tag; use
#between registry and image path for Enroot (see example below) - NGC_API_KEY: Must be exported in your environment before running the script (for example,
export NGC_API_KEY=<your_key>)
Use a shared filesystem path for ROOT_DIR and CACHE_PATH so that the SQSH image and cache are visible from the node where the job runs. Use a node-local or large-quota path for TMP_PATH if /tmp has strict quotas (for example, Lustre scratch).
Save the following as openfold2_srun.sh and run it with bash openfold2_srun.sh:
Submit the job (interactive):
Alternatively, for a batch job, wrap the same script body in an sbatch script and set ACCOUNT, PARTITION, and other Slurm directives as needed. Ensure NGC_API_KEY is exported or passed into the job environment.
4. Call the API From Your Machine
After the container is running on a compute node, the script prints the node name and saves it to ROOT_DIR/.openfold2_node.
-
From your laptop or the login node, create an SSH tunnel to that node:
Or use the node name directly if you know it:
-
In another terminal (with the tunnel still open), run a test request:
If the request succeeds, you will get a JSON response containing the prediction result.