Getting Docker to Play Nice with Intel® Iris® Xe Graphics on Windows 11 WSL2
Docker is a popular containerization platform, and Windows Subsystem for Linux (WSL2) on Windows 11 provides a great way to run Linux containers on a Windows machine. However, getting Docker to work seamlessly with Intel® Iris® Xe Graphics can be a bit tricky. In this article, we'll cover the key concepts and steps necessary to get Docker and Intel® Iris® Xe Graphics working together on Windows 11 with WSL2.
Prerequisites
- A Windows 11 machine with the latest updates installed
- The latest version of Docker Desktop installed
- An Ubuntu distribution installed and configured for WSL2
- Docker Desktop configured to share the WSL2 distribution
Enabling 3D Acceleration for WSL2
To enable 3D acceleration for WSL2, you need to modify the /etc/wsl.conf file in your Ubuntu distribution. Here's an example configuration file that enables 3D acceleration:
[wsl2]
enabled = true
guiApplications = true
logLevel = verbose
localhostForwarding = true
After modifying the /etc/wsl.conf file, restart your Ubuntu distribution to apply the changes. You can verify that 3D acceleration is enabled by running the following command:
glxinfo | grep "OpenGL renderer"
The output should include D3D12 (Intel® Iris® Xe Graphics), indicating that 3D acceleration is enabled.
Running Docker Containers with 3D Acceleration
To run Docker containers with 3D acceleration, you need to pass the appropriate flags to the docker run command. Here's an example command that runs a Docker container with 3D acceleration:
docker run --gpus all -it --rm ubuntu nvidia-smi
The --gpus all flag tells Docker to use all available GPUs, and the nvidia-smi command is used to verify that 3D acceleration is working inside the container.
Troubleshooting
If you encounter issues with Docker and Intel® Iris® Xe Graphics on Windows 11 with WSL2, here are some troubleshooting steps to try:
- Make sure that Docker Desktop is configured to share the WSL2 distribution
- Verify that 3D acceleration is enabled in the
/etc/wsl.conffile - Restart the WSL2 distribution and Docker Desktop
- Check the Docker and WSL2 logs for error messages
Getting Docker to play nice with Intel® Iris® Xe Graphics on Windows 11 with WSL2 can be a bit tricky, but with the right configuration and flags, it's possible to run Docker containers with 3D acceleration. By following the steps outlined in this article, you can ensure that Docker and Intel® Iris® Xe Graphics work seamlessly together on Windows 11 with WSL2.