feat: support WSL2 D3D12 GzSim sessions - #300
Open
karttikjangid wants to merge 1 commit into
Open
Conversation
javizqh
requested changes
Aug 20, 2026
Member
There was a problem hiding this comment.
This is irrelevant to the changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a WSL2-specific GzSim, VNC, and Python-exercise launch path for RoboticsAcademy running through Docker Desktop on Windows.
This is the RAM companion to [RoboticsAcademy #3973](JdeRobot/RoboticsAcademy#3973), which fixes the Windows-specific Docker Compose configuration.
Important Info :
I am currently still working on this but finding out a way to make the windows workflow is proving to be very hard . There maybe more commits associated with this .
Why this is needed
The existing Docker workflow and GPU documentation are Linux-oriented:
/dev/dri./dev/dri.Docker Desktop with WSL2 exposes the GPU through
/dev/dxg, not/dev/dri.Therefore, attempting to start the Windows Compose configuration with
/dev/drifails before the container starts. That startup failure is fixed separately by [RoboticsAcademy #3973](JdeRobot/RoboticsAcademy#3973).However, removing
/dev/drialone is insufficient: RAM then treats the WSL2 container as having no GPU and continues to use a VNC/GPU path that assumes native Linux DRI devices. This PR adds the missing RAM runtime support for the WSL2 graphics stack.Changes
Detect WSL2 GPU access
check_gpu_acceleration()now checks for/dev/dxgbefore the existing/dev/drilogic.When
/dev/dxgexists, RAM verifies NVIDIA visibility withnvidia-smiand reports NVIDIA acceleration when it succeeds.This avoids incorrectly disabling GPU acceleration only because
/dev/driis absent in WSL2.Add a WSL2 VNC backend
GzSim sessions on WSL2 now use:
This backend was verified independently with an actual browser/noVNC session, including a completed RFB connection and framebuffer negotiation.
The implementation:
pkillorfuser -k.Use the D3D12 OpenGL path for GzSim
For the WSL2 branch only, GzSim is started with:
The setting is local to the GzSim process. It is not added to the container-wide environment and does not affect native Linux GPU rendering.
Start Python exercises with the required ROS environment
For WSL2 Python exercise entrypoints, RAM now starts the program after sourcing:
It also supplies the workspace HAL, GUI, and console interface paths through
PYTHONPATH.This fixes Python exercise startup in the WSL2 development container, where launching
academy.pydirectly can otherwise fail to import the required ROS/HAL interfaces.exec python3is used so the process tracked by RAM remains the actual exercise process and preserves normal signal handling.Cross-platform behaviour
The new path is selected exclusively by the presence of
/dev/dxg./dev/dxgexists, so RAM uses the Xvfb/x11vnc/noVNC backend and D3D12 rendering path./dev/dri:/dev/dxgis absent, so the existing TurboVNC/VirtualGL GPU path is unchanged./dev/dxgis absent, so the existing CPU VNC path is unchanged.No existing Linux or macOS branch is changed.
Validation
Validated in a Windows 11, Docker Desktop, WSL2, NVIDIA environment:
/dev/dxgis present and/dev/driis absent in the container.GALLIUM_DRIVER=d3d12 glxinfo -Breports hardware-accelerated D3D12/NVIDIA rendering when run with an X server./dev/dxgcondition.Related work and scope
/dev/driLinux behaviour, or ZIP/archive handling.src, so this RAM revision must be checked out there until the change is released in a RoboticsAcademy image.Why the existing Windows workflow fails
The existing documented Windows workflow describes a Linux GPU workflow based on
/dev/dri, Linux NVIDIA runtime installation, legacydocker-compose, and generic copied Compose files.Docker Desktop owns Docker on Windows, and WSL2 GPU rendering uses
/dev/dxg.PR #3973 fixes the container-start layer. This RAM PR fixes the runtime layer after the container starts.