Troubleshooting GPU Visibility in Docker Containers
If your GPU is visible on the host using nvidia-smi but not inside a Docker container, follow these steps to resolve the issue:
-
Check Docker Compose Configuration: Ensure your
docker-compose.ymlfile includes thecount: allline under thedeploysection. This allows Docker to access all available GPUs.version: '3.9'services:your_service_name:image: your_image_namedeploy:resources:reservations:devices:- driver: nvidiacount: allcapabilities: [gpu] -
Obtain New Docker Compose File: If your
docker-compose.ymlfile does not include thecount: allline, obtain a newdocker-compose.ymlfile from the Comprimato Customer Dashboard. Follow the instructions provided to download the updated file from the Run Docker Container guide. -
Verify NVIDIA Container Toolkit Installation: Make sure the NVIDIA Container Toolkit is installed on your host machine. You can follow the installation guide in your platform's preparation guide.
-
Check NVIDIA-SMI Inside Container: After starting the container, run
nvidia-smiinside the container to verify GPU visibility.
docker exec -it transcoder0 nvidia-smi
By following these steps, you should be able to resolve the issue of GPU visibility inside your Docker container.