NCP-AII Question 118
Select 3You are tasked with deploying a deep learning application on a server equipped with NVIDIA GPUs using Docker. Which of the following steps are necessary to ensure the Docker container has access to the GPUs?
- A
Install the NVIDIA Container Toolkit on the host machine.
- B
Use the
--gpusflag when running the Docker container to specify GPU access. - C
Ensure NVIDIA GPU drivers are installed on the host machine.
- D
Include the GPU model in the Dockerfile when building the container.
- E
Run the Docker container with elevated privileges using the
--privilegedflag.
Show answer and explanation
Correct answers: A, B, C
Explanation
To use NVIDIA GPUs with Docker, the NVIDIA Container Toolkit must be installed, and the NVIDIA GPU drivers must be present on the host system to enable GPU communication. Additionally, the --gpus flag is used at runtime to allocate GPU resources to the container. Including the GPU model in the Dockerfile or running the container with elevated privileges are unnecessary steps for enabling GPU usage.
- A. Correct.
Correct: The NVIDIA Container Toolkit is required on the host machine to enable GPU support for Docker containers.
- B. Correct.
Correct: The
--gpusflag is used to specify which GPUs the container should have access to at runtime. - C. Correct.
Correct: NVIDIA GPU drivers must be installed on the host machine to enable communication between the containerized applications and the GPUs.
- D. Incorrect.
Incorrect: GPU models are specified at runtime using the
--gpusflag, not in the Dockerfile. The Dockerfile is typically used for software dependencies and configuration. - E. Incorrect.
Incorrect: Using the
--privilegedflag is not required to provide GPU access. GPU access is managed by installing the NVIDIA Container Toolkit and using the--gpusflag.