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

Hardware-accelerated vulkan in WSL2 #7790

Open
1 of 2 tasks
agluszak opened this issue Dec 1, 2021 · 19 comments
Open
1 of 2 tasks

Hardware-accelerated vulkan in WSL2 #7790

agluszak opened this issue Dec 1, 2021 · 19 comments

Comments

@agluszak
Copy link

agluszak commented Dec 1, 2021

Version

Microsoft Windows [Version 10.0.22000.348]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.10.60.1

Distro Version

Ubuntu 21.04

Other Software

GPU: AMD Ryzen 7 5800U IGPU

AMD drivers version: https://www.amd.com/en/support/kb/release-notes/rn-rad-win-wsl-support (recommended for use with WSL)

vulkaninfo --summary
WARNING: lavapipe is not a conformant vulkan implementation, testing use only.
==========
VULKANINFO
==========

Vulkan Instance Version: 1.2.162


Instance Extensions: count = 18
-------------------------------
VK_EXT_acquire_xlib_display            : extension revision 1
VK_EXT_debug_report                    : extension revision 10
VK_EXT_debug_utils                     : extension revision 2
VK_EXT_direct_mode_display             : extension revision 1
VK_EXT_display_surface_counter         : extension revision 1
VK_KHR_device_group_creation           : extension revision 1
VK_KHR_display                         : extension revision 23
VK_KHR_external_fence_capabilities     : extension revision 1
VK_KHR_external_memory_capabilities    : extension revision 1
VK_KHR_external_semaphore_capabilities : extension revision 1
VK_KHR_get_display_properties2         : extension revision 1
VK_KHR_get_physical_device_properties2 : extension revision 2
VK_KHR_get_surface_capabilities2       : extension revision 1
VK_KHR_surface                         : extension revision 25
VK_KHR_surface_protected_capabilities  : extension revision 1
VK_KHR_wayland_surface                 : extension revision 6
VK_KHR_xcb_surface                     : extension revision 6
VK_KHR_xlib_surface                    : extension revision 6

Instance Layers: count = 3
--------------------------
VK_LAYER_KHRONOS_validation Khronos Validation Layer     1.2.162  version 1
VK_LAYER_MESA_device_select Linux device selection layer 1.2.73   version 1
VK_LAYER_MESA_overlay       Mesa Overlay layer           1.1.73   version 1

Devices:
========
GPU0:
        apiVersion         = 4202691 (1.2.195)
        driverVersion      = 1 (0x0001)
        vendorID           = 0x10005
        deviceID           = 0x0000
        deviceType         = PHYSICAL_DEVICE_TYPE_CPU
        deviceName         = llvmpipe (LLVM 13.0.0, 256 bits)
        driverID           = DRIVER_ID_MESA_LLVMPIPE
        driverName         = llvmpipe
        driverInfo         = Mesa 21.3.0 - kisak-mesa PPA (LLVM 13.0.0)
        conformanceVersion = 0.0.0.0

Repro Steps

Run vulkaninfo --summary

Expected Behavior

I expect vulkan to use the actual GPU in WSL2

Actual Behavior

It uses lavapipe software emulation

Diagnostic Logs

No response

@ghost
Copy link

ghost commented Dec 1, 2021

Nice try 😄

@letrhee
Copy link

letrhee commented Dec 2, 2021

There don't seem to be any plans to provide Vulkan natively. The links https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12209 https://gitlab.freedesktop.org/bbrezillon/mesa/-/branches/active may help.

@engineer1109
Copy link

llvmpipe is CPU..

@GeorgeS2019
Copy link

GeorgeS2019 commented Apr 2, 2022

Anyone attempting WSL2 Vulkan Nvidia?

Vulkan Driver Support

@GeorgeS2019
Copy link

GeorgeS2019 commented Apr 3, 2022

@GeorgeS2019
Copy link

Version

Microsoft Windows [Version 11.0.22000.556

WSL Version

  • WSL 2
  • WSL 1

Distro Version

Ubuntu 20.04

$ vulkaninfo --summary

WARNING: [Loader Message] Code 0 : terminator_CreateInstance: Failed to CreateInstance in ICD 2.  Skipping ICD.
WARNING: lavapipe is not a conformant vulkan implementation, testing use only.
==========
VULKANINFO
==========

Vulkan Instance Version: 1.3.204


Instance Extensions: count = 18
-------------------------------
VK_EXT_acquire_xlib_display            : extension revision 1
VK_EXT_debug_report                    : extension revision 9
VK_EXT_debug_utils                     : extension revision 2
VK_EXT_direct_mode_display             : extension revision 1
VK_EXT_display_surface_counter         : extension revision 1
VK_KHR_device_group_creation           : extension revision 1
VK_KHR_display                         : extension revision 23
VK_KHR_external_fence_capabilities     : extension revision 1
VK_KHR_external_memory_capabilities    : extension revision 1
VK_KHR_external_semaphore_capabilities : extension revision 1
VK_KHR_get_display_properties2         : extension revision 1
VK_KHR_get_physical_device_properties2 : extension revision 1
VK_KHR_get_surface_capabilities2       : extension revision 1
VK_KHR_surface                         : extension revision 25
VK_KHR_surface_protected_capabilities  : extension revision 1
VK_KHR_wayland_surface                 : extension revision 6
VK_KHR_xcb_surface                     : extension revision 6
VK_KHR_xlib_surface                    : extension revision 6

Instance Layers: count = 10
---------------------------
VK_LAYER_KHRONOS_profiles         Khronos Profiles layer                              1.3.204  version 1
VK_LAYER_KHRONOS_synchronization2 Khronos Synchronization2 layer                      1.3.204  version 1
VK_LAYER_KHRONOS_validation       Khronos Validation Layer                            1.3.204  version 1
VK_LAYER_LUNARG_api_dump          LunarG API dump layer                               1.3.204  version 2
VK_LAYER_LUNARG_device_simulation LunarG device simulation layer                      1.3.204  version 1
VK_LAYER_LUNARG_gfxreconstruct    GFXReconstruct Capture Layer Version 0.9.11-unknown 1.3.204  version 36875
VK_LAYER_LUNARG_monitor           Execution Monitoring Layer                          1.3.204  version 1
VK_LAYER_LUNARG_screenshot        LunarG image capture layer                          1.3.204  version 1
VK_LAYER_MESA_device_select       Linux device selection layer                        1.2.73   version 1
VK_LAYER_MESA_overlay             Mesa Overlay layer                                  1.1.73   version 1

Devices:
========
GPU0:
        apiVersion         = 4202691 (1.2.195)
        driverVersion      = 1 (0x0001)
        vendorID           = 0x10005
        deviceID           = 0x0000
        deviceType         = PHYSICAL_DEVICE_TYPE_CPU
        deviceName         = llvmpipe (LLVM 10.0.0, 256 bits)
        driverID           = DRIVER_ID_MESA_LLVMPIPE
        driverName         = llvmpipe
        driverInfo         = Mesa 22.0.0-devel (git-f4c426422b) (LLVM 10.0.0)
        conformanceVersion = 0.0.0.0
        deviceUUID         = 00000000-0000-0000-0000-000000000000
        driverUUID         = 00000000-0000-0000-0000-000000000000

@GeorgeS2019
Copy link

GeorgeS2019 commented Apr 8, 2022

Vulkan through WSLg - Not Yet

@GeorgeS2019
Copy link

GeorgeS2019 commented Apr 19, 2022

@agluszak @procedural @engineer1109 @mortim @therealkenc

The latest WIP hardware-accelerated Vulkan in WSL2 ( through Dozen over Directx12)

@GeorgeS2019
Copy link

hardware accelerated Vulkan now works in WSL2

@GeorgeS2019
Copy link

@Nolram12345
Copy link

Is there any guide on how to actually install dozen on WSL2 (Ubuntu) ?

@GeorgeS2019
Copy link

GeorgeS2019 commented Apr 6, 2024

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

microsoft/wslg#40 (comment)

@Nolram12345
Copy link

Oh wow, that was surprisingly easy. Thank you!

@JustLuoxi
Copy link

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

microsoft/wslg#40 (comment)

Many thanks! It works! I can finally run the isaamgym in wsl2!!! ❤

@Ukua
Copy link

Ukua commented Apr 28, 2024

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

microsoft/wslg#40 (comment)Microsoft/WSLG#40 (注释)

Many thanks! It works! I can finally run the isaamgym in wsl2!!! ❤非常感谢!它有效!我终于可以在 wsl2 中运行 isaamgym!!❤

How to run isaac sim in wsl2? I tryed the same cmd, isaac sim seems to start up but finally crushed with OUT OF MEMORY error

2024-04-28 04:44:41 [29,267ms] [Warning] [omni.particle.system.core.scripts.extension]
            ATTENTION!: omni.particle.system.core is currently undergoing extensive (breaking) changes.
            Please be aware that systems built with the existing extension will need to be rebuilt in
            the USD Composer 2023.2 release.
[29.299s] [ext: omni.kit.sequencer.core-103.4.0] startup
[29.323s] [ext: omni.anim.widget.timeline-0.1.8] startup
[29.363s] [ext: omni.kit.quicksearch.actions-0.8.11] startup
[29.369s] [ext: omni.kit.converter.cad_core-200.1.0-rc.22] startup
LLVM ERROR: out of memory
2024-04-28 04:44:42 [0ms] [Warn] [carb.crashreporter-breakpad.plugin] [crash] A crash has occurred.  If a debugger should be attached, please set the '/crashreporter/debuggerAttachTimeoutMs' setting to a timeout in milliseconds.  This can be used to allow the crash reporter to wait for up to that long for a debugger to attach before processing or sending the crash report.
prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY) failed: 22/Invalid argument
prctl(PR_SET_PTRACER, 0) failed: 22[1]    170596 segmentation fault  ./isaac-sim.sh --reset-user

@phgandhi02
Copy link

phgandhi02 commented May 14, 2024

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

microsoft/wslg#40 (comment)

Many thanks! It works! I can finally run the isaamgym in wsl2!!! ❤

Same here. How did you get isaac-gym working in wsl2? I've been trying to get isaac sim working in wsl2 and I keep running into segmentation faults. I tried installing the repository but that didn't do anything. I downloaded vulkan-tools. Please let me know if I have to grab something else.

I ran the following:

vulkaninfo --summary
WARNING: [Loader Message] Code 0 : terminator_CreateInstance: Failed to CreateInstance in ICD 1.  Skipping ICD.
WARNING: dzn is not a conformant Vulkan implementation, testing use only.
==========
VULKANINFO
==========

Vulkan Instance Version: 1.3.204


Instance Extensions: count = 20
-------------------------------
VK_EXT_acquire_drm_display             : extension revision 1
VK_EXT_acquire_xlib_display            : extension revision 1
VK_EXT_debug_report                    : extension revision 10
VK_EXT_debug_utils                     : extension revision 2
VK_EXT_direct_mode_display             : extension revision 1
VK_EXT_display_surface_counter         : extension revision 1
VK_EXT_swapchain_colorspace            : extension revision 4
VK_KHR_device_group_creation           : extension revision 1
VK_KHR_display                         : extension revision 23
VK_KHR_external_fence_capabilities     : extension revision 1
VK_KHR_external_memory_capabilities    : extension revision 1
VK_KHR_external_semaphore_capabilities : extension revision 1
VK_KHR_get_display_properties2         : extension revision 1
VK_KHR_get_physical_device_properties2 : extension revision 2
VK_KHR_get_surface_capabilities2       : extension revision 1
VK_KHR_surface                         : extension revision 25
VK_KHR_surface_protected_capabilities  : extension revision 1
VK_KHR_wayland_surface                 : extension revision 6
VK_KHR_xcb_surface                     : extension revision 6
VK_KHR_xlib_surface                    : extension revision 6

Instance Layers: count = 3
--------------------------
VK_LAYER_INTEL_nullhw       INTEL NULL HW                1.1.73   version 1
VK_LAYER_MESA_device_select Linux device selection layer 1.3.211  version 1
VK_LAYER_MESA_overlay       Mesa Overlay layer           1.3.211  version 1

Devices:
========
GPU0:
        apiVersion         = 4202770 (1.2.274)
        driverVersion      = 100663303 (0x6000007)
        vendorID           = 0x10de
        deviceID           = 0x2523
        deviceType         = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
        deviceName         = Microsoft Direct3D12 (NVIDIA GeForce RTX 3050 Ti Laptop GPU)
        driverID           = UNKNOWN_VkDriverId_value23
        driverName         = Dozen
        driverInfo         = Mesa 24.0.7 - kisak-mesa PPA
        conformanceVersion = 0.0.0.0
        deviceUUID         = 0a5805bc-e528-f891-fa07-d868b45599ea
        driverUUID         = ba8648b5-dfcb-1cc5-3ce1-236da2853a45
GPU1:
        apiVersion         = 4206866 (1.3.274)
        driverVersion      = 1 (0x0001)
        vendorID           = 0x10005
        deviceID           = 0x0000
        deviceType         = PHYSICAL_DEVICE_TYPE_CPU
        deviceName         = llvmpipe (LLVM 15.0.7, 256 bits)
        driverID           = DRIVER_ID_MESA_LLVMPIPE
        driverName         = llvmpipe
        driverInfo         = Mesa 24.0.7 - kisak-mesa PPA (LLVM 15.0.7)
        conformanceVersion = 1.3.1.1
        deviceUUID         = 6d657361-3234-2e30-2e37-202d206b6900
        driverUUID         = 6c6c766d-7069-7065-5555-494400000000

@PoneyUHC
Copy link

@GeorgeS2019 many thanks it helped me so quickly, I was following a vk tutorial and when came the moment to render something real, the performances were horrible. Solved it instantly !

@hopeux
Copy link

hopeux commented Dec 6, 2024

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

microsoft/wslg#40 (comment)

Totaly works fine! Thanks.

@R-Bower
Copy link

R-Bower commented Dec 19, 2024

I've been searching all over and this thread looked promising. I've tried everything here but still can't seem to get my chrome browser to use GPU rendering. I'm running Ubuntu 24.04 with WSL version: 2.3.26.0, and an RTX 4090 mobile GPU.

I am using a custom XServer (the default provided by GWSL).

export MESA_D3D12_DEFAULT_ADAPTER_NAME='NVIDIA'
export DISPLAY=":0"
export LD_LIBRARY_PATH=/usr/lib/wsl/lib
glxinfo -B | grep OpenGL
OpenGL vendor string: Mesa
OpenGL renderer string: llvmpipe (LLVM 17.0.6, 256 bits)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 24.3.1 - kisak-mesa PPA
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL version string: 4.5 (Compatibility Profile) Mesa 24.3.1 - kisak-mesa PPA
OpenGL shading language version string: 4.50
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 24.3.1 - kisak-mesa PPA
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
google-chrome

(google-chrome:2848): Gtk-WARNING **: 22:21:39.691: Failed to parse /home/rbower/.config/gtk-3.0/settings.ini: Key file does not start with a group
WARNING: dzn is not a conformant Vulkan implementation, testing use only.
WARNING: dzn is not a conformant Vulkan implementation, testing use only.
[2885:2885:1218/222143.544706:ERROR:angle_platform_impl.cc(44)] Display.cpp:1062 (initialize): ANGLE Display::initialize error 12289: Invalid visual ID requested.
ERR: Display.cpp:1062 (initialize): ANGLE Display::initialize error 12289: Invalid visual ID requested.
[2885:2885:1218/222143.545418:ERROR:gl_display.cc(497)] EGL Driver message (Critical) eglInitialize: Invalid visual ID requested.
[2885:2885:1218/222143.545513:ERROR:gl_display.cc(767)] eglInitialize OpenGL failed with error EGL_NOT_INITIALIZED, trying next display type
[2885:2885:1218/222143.546295:ERROR:angle_platform_impl.cc(44)] Display.cpp:1062 (initialize): ANGLE Display::initialize error 12289: Invalid visual ID requested.

Any ideas?

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

No branches or pull requests