Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSL2 :OpenGL vendor string: Microsoft Corporation OpenGL renderer string: D3D12 and OpenGL.raw.EGL._errors.EGLError: #1302

Open
jvwangyi opened this issue Dec 3, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@jvwangyi
Copy link

jvwangyi commented Dec 3, 2024

Is your feature request related to a problem:

n WSL2, when using EGL for headless rendering, I encounter the error chmod: cannot access '/dev/dri/renderD128': No such file or directory, and after changing permissions, I get the following warnings:

CUDA_VISIBLE_DEVICES: 0
libEGL warning: MESA-LOADER: failed to open vgem: /usr/lib/dri/vgem_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)

libEGL warning: NEEDS EXTENSION: falling back to kms_swrast
libEGL warning: MESA-LOADER: failed to open kms_swrast: /usr/lib/dri/kms_swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)

OpenGL.raw.EGL._errors.EGLError: EGLError(
err = EGL_NOT_INITIALIZED,
baseOperation = eglInitialize,
cArguments = (
<OpenGL._opaque.EGLDisplay_pointer object at 0x7fa4e04190c0>,
c_long(0),
c_long(0),
),
result = 0
)

Describe the solution you'd like:

It seems to be because WSL2 uses the D3D12 virtual rendering, and I want to know if it is possible to use a new driver in WSL2 that can directly access the actual GPU.

Describe alternatives you've considered:

I am looking for a mechanism that can initialize the OpenGL context. Without using EGL, when trying to get the GPU ID, it directly throws an error indicating that the OpenGL context cannot be retrieved. I would like a mechanism that makes it easier to use my GPU in WSL2. Thank you.

Additional context:

My GPU does support hardware-accelerated tasks, and it seems that this error occurs when the hardware rendering option is enabled.

@jvwangyi jvwangyi added the enhancement New feature or request label Dec 3, 2024
@jvwangyi
Copy link
Author

jvwangyi commented Dec 4, 2024

In the WSL2 environment, EGL typically accesses GPU-accelerated resources through Mesa or other EGL implementations. If an EGL program currently accesses /dev/dri/renderD128, it uses the standard DRM (Direct Rendering Manager) interface in the Linux environment. This is different from the Direct3D 12 channel provided by /dev/dxg. Is it possible to provide an interface that allows EGL to access the WSLg virtual DXG?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant