NVIDIA container toolkit installation and GPU use with Docker: Practice Questions — Control Plane Installation and Configuration (NVIDIA-Certified Professional: AI Infrastructure)
Practice Questions: NVIDIA Container Toolkit Installation and GPU Use with Docker These multiple-choice questions are designed to help candidates...
Practice Questions: NVIDIA Container Toolkit Installation and GPU Use with Docker
These multiple-choice questions are designed to help candidates prepare for the NVIDIA-Certified Professional: AI Infrastructure exam, focusing specifically on the installation of the NVIDIA container toolkit and leveraging GPUs within Docker containers.
Which command is used to install the NVIDIA Container Toolkit on a Linux system?
- A. apt-get install nvidia-container-toolkit
- B. curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - followed by repository setup and apt-get install -y nvidia-docker2
- C. docker install nvidia-toolkit
- D. nvidia-smi --install-toolkit
Correct answer: B
Explanation: Installing the NVIDIA Container Toolkit requires adding the NVIDIA Docker repository and GPG key, then installing the nvidia-docker2 package. Option B outlines the correct process. Option A is incorrect because the package name is nvidia-docker2, not nvidia-container-toolkit. Options C and D are invalid commands.
After installing the NVIDIA Container Toolkit, which Docker runtime must be specified to enable GPU support in containers?
- A. runc
- B. nvidia
- C. docker-gpu
- D. gpu-runtime
Correct answer: B
Explanation: The NVIDIA Container Toolkit configures a Docker runtime called nvidia that enables GPU access inside containers. This runtime must be specified with the --runtime=nvidia flag when running containers. Other options are not recognized Docker runtimes for GPU support.
Which environment variable is commonly used inside a Docker container to verify GPU visibility?
- A. CUDA_VISIBLE_DEVICES
- B. GPU_ACCESS
- C. DOCKER_GPU
- D. NVIDIA_VISIBLE_DEVICES
Correct answer: D
Explanation: NVIDIA_VISIBLE_DEVICES controls which GPUs are visible inside the container. Setting this variable allows fine-grained control over GPU access. CUDA_VISIBLE_DEVICES is used by CUDA applications but is not set by the container runtime itself.
What is the purpose of the nvidia-smi command inside a Docker container using the NVIDIA runtime?
- A. To install GPU drivers
- B. To monitor GPU usage and status
- C. To configure Docker networking
- D. To update the container image
Correct answer: B
Explanation: nvidia-smi is a utility to query and monitor GPU status, including utilization, temperature, and processes. Running it inside a container confirms that the GPU is accessible and functioning correctly.
Which Docker run option is necessary to enable GPU support when launching a container?
- A. --gpus all
- B. --enable-gpu
- C. --runtime=gpu
- D. --device=gpu0
Correct answer: A
Explanation: The --gpus all flag is the recommended way to enable GPU access in Docker containers with recent versions of Docker and the NVIDIA Container Toolkit. It automatically configures the container to access all GPUs. Other options are deprecated or incorrect.
Which of the following is a prerequisite for successful NVIDIA Container Toolkit installation?
- A. Installing the CUDA Toolkit inside the container
- B. Having the NVIDIA GPU driver installed on the host system
- C. Running Docker in privileged mode
- D. Using a specific Linux distribution only
Correct answer: B
Explanation: The NVIDIA GPU driver must be installed on the host system because the container toolkit relies on the host driver to provide GPU functionality inside containers. Installing CUDA inside the container is optional depending on the workload.
Which command verifies that the NVIDIA Container Toolkit is correctly installed and configured on the host?
- A. docker info | grep NVIDIA
- B. nvidia-container-cli info
- C. docker run --rm nvidia/cuda:11.0-base nvidia-smi
- D. All of the above
Correct answer: D
Explanation: All these commands help verify the installation: docker info shows if the NVIDIA runtime is recognized; nvidia-container-cli info provides detailed info about the container runtime; running a CUDA container with nvidia-smi tests GPU access inside a container.
More in this topic
Ready to test your knowledge?
Put what you've learned into practice with a quick quiz and track your progress.
Test your knowledge →