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.yml
file includes thecount: all
line under thedeploy
section. This allows Docker to access all available GPUs.version: '3.9' services: your_service_name: image: your_image_name deploy: resources: reservations: devices: - driver: nvidia count: all capabilities: [gpu]
- Obtain New Docker Compose File: If your
docker-compose.yml
file does not include thecount: all
line, obtain a newdocker-compose.yml
file from the Comprimato Customer Dashboard. Follow the instructions provided to download the updated file here. - Verify NVIDIA Container Toolkit Installation: Make sure the NVIDIA Container Toolkit is installed on your host machine. You can follow the installation guide here.
- Check NVIDIA-SMI Inside Container: After starting the container, run
nvidia-smi
inside 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.
Updated about 5 hours ago