Skip to content

Add support for Vulkan #40

@simonferquel

Description

@simonferquel

Is your feature request related to a problem? Please describe.
Currently, trying to run any app leveraging Vulkan seems to end up with a Segfault

Unity with an HDRP (Vulkan dependant) project:
image

vulkaninfo:
image

Describe the solution you'd like
Having Vulkan work out of the box just like OpenGL

Activity

nxrighthere

nxrighthere commented on Apr 22, 2021

@nxrighthere

This would be an extremely useful feature, looking forward to it!

Zingam

Zingam commented on Jun 15, 2021

@Zingam

I hope it will be Vulkan pass-through driver which won't be obstructed by BIOS limitations or at least Molten VK but hopefully it won't be an emulation.

Vulkan, Wayland and Pipewire for a modern desktop experience!

ahupp

ahupp commented on Oct 13, 2021

@ahupp

I get the segfault even when (I think?) I've requested the lavapipe software renderer, so I suspect this is at least partly a regular bug rather than an unimplemented feature:

VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.x86_64.json vulkaninfo

The actual fault is in libVkLayer_MESA_device_select.so:

* thread #1, name = 'vulkaninfo', stop reason = signal SIGSEGV: invalid address (fault address: 0x18)
  * frame #0: 0x00007ffff7e49d75 libwayland-client.so.0`wl_proxy_destroy + 21
    frame #1: 0x00007ffff16a6b37 libVkLayer_MESA_device_select.so`___lldb_unnamed_symbol23$$libVkLayer_MESA_device_select.so + 247
    frame #2: 0x00007ffff16a5ff4 libVkLayer_MESA_device_select.so`___lldb_unnamed_symbol11$$libVkLayer_MESA_device_select.so + 1252
    frame #3: 0x00007ffff7e18bdb libvulkan.so.1`___lldb_unnamed_symbol296$$libvulkan.so.1 + 107
    frame #4: 0x00007ffff7e1b849 libvulkan.so.1`vkEnumeratePhysicalDevices + 73
    frame #5: 0x00005555555a7c45 vulkaninfo`___lldb_unnamed_symbol447$$vulkaninfo + 85
    frame #6: 0x0000555555562a6a vulkaninfo`___lldb_unnamed_symbol175$$vulkaninfo + 330
    frame #7: 0x00007ffff7a240b3 libc.so.6`__libc_start_main + 243
    frame #8: 0x00005555555641ee vulkaninfo`___lldb_unnamed_symbol177$$vulkaninfo + 46

It looks like I can disable this with NODEVICE_SELECT=1, but that leads to a different error:

NODEVICE_SELECT=1 VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.x86_64.json vulkani
nfo
/build/vulkan-tools-KEbD_A/vulkan-tools-1.2.131.1+dfsg1/vulkaninfo/vulkaninfo.h:939: failed with ERROR_SURFACE_LOST_KHR
WSLUser

WSLUser commented on Jul 7, 2022

@WSLUser

Zink may be able to provide a partial solution as it's written to take advantage of D3D12 being available in Mesa but is applied to Vulkan. Not sure how to better explain than that. But if you look at the code you'll see it's for Vulkan but it also pulls in and uses code from the D3D12 implementation of Mesa. It also appears that MS is involved in developing that Gallium driver too so perhaps the maintainers here can speak better on it. My impression from reviewing it on Mesa's gitlab page is basically to make Vulkan available through the D3D12 driver (the kernel driver, not the mesa gallium to be clear) but I could be mistaken.

Biswa96

Biswa96 commented on Jul 7, 2022

@Biswa96
Contributor
WSLUser

WSLUser commented on Jul 7, 2022

@WSLUser

Well that's a fairly new development considering Zink is over a year old now. But then it wasn't originally using any functions from D3D12 either. That is definitely a nice and necessary bit to get Vulkan working for us. But that also means we'll need to wait until the next release of Vulkan before that change and other related ones are available. What that might mean for WSLg at that point, who knows. Would be nice if the MS folks would chip in here and explain the situation. They promised us Vulkan support and we're seeing efforts that appear on surface to be doing that but no official communication confirming that.

letrhee

letrhee commented on Jul 8, 2022

@letrhee

4 remaining items

Triptolemus

Triptolemus commented on Jan 9, 2024

@Triptolemus

With that, I guess Vulkan is sort of supported in WSLg.

Any idea if it is possible to get Vulkan working in a docker image running on WSL?

selmiskr

selmiskr commented on Mar 15, 2024

@selmiskr

See microsoft/WSL#11303

I'm not able to get Vulkan working in a docker container on WSL2. On WSL2 it recognizes my GPU (and CPU) but within the docker container it only recognizes the CPU. Anyone else stumbling upon this problem?

onomatopellan

onomatopellan commented on Apr 2, 2024

@onomatopellan
Contributor

@selmiskr If it works in WSL2 but not in the docker container take a look at the required environment variables for "Containerized applications access to the vGPU".

GeorgeS2019

GeorgeS2019 commented on Apr 3, 2024

@GeorgeS2019

@daweifeng

What version WSL is needed for Vulkan to work.

Is there a latest update article on this?

selmiskr

selmiskr commented on Apr 4, 2024

@selmiskr

Why is my Vulkan Instance Version on WSL2 different than on Windows

image

vs

image

I installed the newest mesa drivers for vulkan on WSL2 and my device is recognized correctly, but it seems to use an old version of Vulkan on WSL2

This is using Ubuntu 20.04. Using Ubuntu 22.04 the version comes closer to the instance version of Windows:

image

GeorgeS2019

GeorgeS2019 commented on Apr 4, 2024

@GeorgeS2019
sudo add-apt-repository ppa:kisak/kisak-mesa
sudo apt update
sudo apt upgrade

Ubuntu 22.04

image

vkcube

Godot4.3 dev5

demo Spectrum with sound working properly

apasarkar

apasarkar commented on Feb 21, 2025

@apasarkar

Like others, my goal here is to use Vulkan + NVIDIA GPU for accelerated graphics within WSL.

Even after doing what @GeorgeS2019 mentioned above, I am still finding that dzn is not a conformant implementation of Vulkan (and Microsoft 3D12 is not a Vulkan compliant adapter). This prevents me from using things like WGPU within WSL to do GPU accelerated rendering. Is there any complete Vulkan ICD I can use for this at the moment?

TheodorEmanuelsson

TheodorEmanuelsson commented on Jul 15, 2025

@TheodorEmanuelsson
sudo add-apt-repository ppa:kisak/kisak-mesa
sudo apt update
sudo apt upgrade

Didn't work for me to run isaacsim unfortunately. Got Skipping NVIDIA GPU due CUDA being in bad state: Microsoft Direct3D12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ahupp@onomatopellan@simonferquel@letrhee@Zingam

        Issue actions

          Add support for Vulkan · Issue #40 · microsoft/wslg