NCP-AII Question 117
Select 3You are tasked with deploying a deep learning application inside a Docker container on a server equipped with NVIDIA GPUs. Which steps are required to ensure the container can utilize the GPU resources effectively?
- A
Install the NVIDIA Container Toolkit on the host machine.
- B
Use the
--gpuflag when building the Docker image. - C
Start the container with the
--gpusoption to specify GPU access. - D
Ensure the NVIDIA driver is installed on the host machine.
- E
Include the
nvidia/cudabase image in the Dockerfile.
Show answer and explanation
Correct answers: A, C, D
Explanation
To enable GPU access in a Docker container, the host machine must have the NVIDIA driver and the NVIDIA Container Toolkit installed. The container itself requires GPU access to be explicitly allowed using the --gpus option when it is started. While using a CUDA base image can make development easier, it is not mandatory for GPU access.
- A. Correct.
Correct: The NVIDIA Container Toolkit is required on the host machine to enable GPU access for Docker containers.
- B. Incorrect.
Incorrect: The
--gpuflag is not used during the Docker image build process. GPU configuration is specified when running the container, not building it. - C. Correct.
Correct: The
--gpusoption is necessary to allocate GPU resources to the container during runtime. - D. Correct.
Correct: The NVIDIA driver must be installed on the host machine to enable GPU communication between the host and the container.
- E. Incorrect.
Incorrect: While using an NVIDIA CUDA base image can simplify building GPU-enabled containers, it is not strictly required to enable GPU access.