NCP-AII Question 116
Select 3You are tasked with deploying an AI training workload on a containerized platform using NVIDIA GPUs. To ensure the container has access to the GPUs and CUDA libraries, which steps should you take to properly configure the environment?
- A
Install the NVIDIA Container Toolkit on the host machine.
- B
Use the NVIDIA-specific runtime by adding
--runtime=nvidiato the Docker run command. - C
Ensure the container image includes the NVIDIA drivers.
- D
Mount the NVIDIA GPU devices explicitly using the
--deviceflag in the Docker run command. - E
Use an NVIDIA base container image that includes CUDA and cuDNN libraries.
Show answer and explanation
Correct answers: A, B, E
Explanation
To use NVIDIA GPUs with Docker, the NVIDIA Container Toolkit must be installed on the host to enable GPU access. The --runtime=nvidia flag is necessary to instruct Docker to use the NVIDIA runtime, which handles GPU resource allocation. Additionally, starting with an NVIDIA base container that includes CUDA and cuDNN simplifies the setup and ensures compatibility. It is not required to mount GPU devices manually or include drivers inside the container, as these are managed by the runtime and host, respectively.
- A. Correct.
Correct. The NVIDIA Container Toolkit is required to enable Docker to interface with NVIDIA GPUs and provide access to GPU resources inside the container.
- B. Correct.
Correct. The NVIDIA runtime (
--runtime=nvidia) ensures that the container can utilize the host's NVIDIA GPUs and associated libraries. - C. Incorrect.
Incorrect. The NVIDIA drivers must be installed on the host machine, not inside the container. Containers leverage the host's drivers via the NVIDIA Container Toolkit.
- D. Incorrect.
Incorrect. Explicitly mounting GPU devices is not necessary when using the NVIDIA runtime, as it abstracts this process.
- E. Correct.
Correct. Using an NVIDIA base container image ensures that CUDA and cuDNN libraries are pre-installed and optimized for the GPU workload.