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_name deploy: resources: reservations: devices: - driver: nvidia count: all capabilities: [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 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-smiinside the container to verify GPU visibility.
docker exec -it transcoder0 nvidia-smiBy following these steps, you should be able to resolve the issue of GPU visibility inside your Docker container.
Updated 7 months ago
