Configuration
Llama 3.1 NemoGuard 8B TopicControl NIM is packaged as a container. You can set environment variables and specify command-line arguments to configure the microservice.
GPU Selection
The container is GPU-accelerated and uses NVIDIA Container Toolkit for access to GPUs on the host.
You can specify the --gpus all command-line argument to the docker run command if the host has one or more of the same GPU model.
If the host has a combination of GPUs, run the container on compute-capable GPUs only.
Expose specific GPUs to the container by using either of the following methods:
-
Specify the
--gpusargument, such as--gpus="device=1". -
Set the
NVIDIA_VISIBLE_DEVICESenvironment variable, such as-e NVIDIA_VISIBLE_DEVICES=1.
Run the nvidia-smi -L command to list the device IDs to specify in the argument or environment variable:
Refer to GPU Enumeration in the NVIDIA Container Toolkit documentation for more information.
Environment Variables
The following table identifies the environment variables that are used in the container.
Set environment variables with the -e command-line argument to the docker run command.
Volumes
The container stores downloaded models in /opt/nim/.cache by default. Set NIM_CACHE_PATH to use a different path inside the container.
To keep the model cache between runs, create a directory on the host:
Bind-mount it to the container path when you run the container:
Without a bind mount, the container downloads the model again each time it starts. The -u "$(id -u)" option runs the container with your user ID to avoid file permission issues. If you set NIM_CACHE_PATH to a different container path, use that path as the bind mount destination.