Prerequisites
- Begin with a 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:
The CUDA Version reported by nvidia-smi is the CUDA version bundled with the
installed driver, not the one used by the container. The OpenFold2 container
ships with a CUDA 13.2 runtime and can run on systems that meet the documented
minimum driver requirement for OpenFold2, through CUDA minor version compatibility.
For more information on enumerating multi-GPU systems, refer to 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): -
Log in to Docker 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 need your API key for this):
After you enter your API key, you might see multiple options for the org and team. Select as desired or press Enter to accept the default.
- Log in to NGC
You need to log in to NGC through Docker and set the NGC_API_KEY environment variable to pull images:
Then, set the relevant environment variables in your shell. You 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 do not 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 and 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, refer to Getting Started.
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 That 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:
If you prefer not to echo the key on the command line, use vi ~/.config/enroot/.credentials or another editor.
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 (refer to the 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 get a JSON response containing the prediction result.