A lightweight Docker container for testing AMD GPU access with ROCm.
- Minimal Arch Linux-based container
- Non-root user with proper GPU access
- Automatic permission fixing on startup
- Simple verification of GPU accessibility with
rocminfo
- Docker and Docker Compose
- AMD GPU with ROCm support
- Linux host with proper GPU drivers installed
-
Build and start the container:
sudo docker compose up --build -d
-
Enter the container:
sudo docker exec -it amdgpu-docker-rocm-test-1 bash
-
Verify GPU access:
rocminfo
Dockerfile
: Minimal container definitiondocker-compose.yml
: Container orchestrationfix-gpu-permissions.sh
: Script to set proper device permissions (automatically created in the container)
If you encounter permission issues:
- Ensure your user is in the
video
andrender
groups on the host - Check that the
RENDER_GID
in docker-compose.yml matches your host's render group ID - Verify that
/dev/kfd
and/dev/dri/*
devices exist and are accessible
This minimal container:
- Creates a non-root user with video and render group access
- Sets up a script to fix GPU device permissions
- Runs the permission script automatically when you log in
- Provides a simple environment for testing GPU access
This minimal container is designed specifically for testing GPU access, while the main container provides a complete development environment. Use this container when you need to:
- Quickly verify GPU accessibility
- Troubleshoot permission issues
- Test basic ROCm functionality
- Create a minimal base for specialized containers