-
Notifications
You must be signed in to change notification settings - Fork 310
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
Vulkan support in WSL2/WSLg #1254
Comments
Logs are required for review from WSL teamIf this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. How to collect WSL logsDownload and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
The scipt will output the path of the log file once done. Once completed please upload the output files to this Github issue. Click here for more info on logging View similar issuesPlease view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it! Open similar issues:
Closed similar issues:
|
/question |
Diagnostic information
|
Transferred to WSLg repo! |
There is a vulkan driver called dozen which run on d3d12 in mesa source package. change the mesa PKGBUILD from
and add the package function. That's the result:
|
thanks that made vulkaninfo and vkcube work! any idea how to get vulkan to use dozen instead of llvmpipe? |
ok I think I realise the issue, there is no dzn_icd.x86_64.json in /usr/share/vulkan/icd.d on my Arch WSL instance but there is dzn_icd.x86_64.json on my ubuntu WSL instance where everything works, not sure why that isnt the case because I did enable microsoft-experimental and vkcube/vulkaninfo did work(they don't work with the standard mesa from the Arch repos). edit: I missed the
part from viruscamp's reply, adding the package function for the dozen driver fixes the issue Here's how I did it: for future readers who come across the thread: In the PKGBUILD for mesa: pkgname=(
'vulkan-mesa-layers'
'opencl-clover-mesa'
'opencl-rusticl-mesa'
'vulkan-intel'
'vulkan-nouveau'
'vulkan-radeon'
'vulkan-swrast'
'vulkan-virtio'
'microsoft-dozen-driver' # add this line
'libva-mesa-driver'
'mesa-vdpau'
'mesa'
)
...
# add this function
package_microsoft-dozen-driver() {
pkgdesc="Microsoft dozen driver"
depends=(
'expat'
'gcc-libs'
'glibc'
'libdrm'
'libelf'
'libx11'
'libxcb'
'libxshmfence'
'llvm-libs'
'zlib'
'zstd'
)
provides=('microsoft-dozen-driver')
_install fakeinstall/usr/share/vulkan/icd.d/dzn_icd.x86_64.json
_install fakeinstall/$_libdir/libvulkan_dzn.so*
install -Dm644 mesa-$pkgver/docs/license.rst -t "$pkgdir/usr/share/licenses/$pkgname"
} The name of the package(and hence the function) is at your discretion, after a rebuild of mesa with these addition's along with viruscamp's change should make vulkan work. I am going to close the issue now as vulkan is supported in WSL, it is upto package maintainers to enable the right flags in the mesa build to make it work. |
i'm running into this same issue and despite everything being in the right place, i'm unable to get d3d12 as my renderer instead of llvmpipe no matter what i do. i'm running an arch wsl2 install with the latest i built the latest mesa from source with the changes that @viruscamp and @AreamanM shared previously using @jaxvanyang 's fork, resulting in successful installation with all of the following present: /usr/share/vulkan/icd.d/dzn_icd.x86_64.json is owned by vulkan-dozen 1:24.2.2-1
/usr/lib/libvulkan_dzn.so is owned by vulkan-dozen 1:24.2.2-1
/usr/lib/dri/d3d12_dri.so is owned by mesa 1:24.2.2-1
/usr/lib/libspirv_to_dxil.so is owned by mesa 1:24.2.2-1 these are the relevant changes to the PKGBUILD: pkgbase=mesa
pkgname=(
...
vulkan-dozen
...
)
pkgver=24.2.2
...
build() {
local meson_options=(
...
-D vulkan-drivers=amd,intel,intel_hasvk,swrast,virtio,nouveau,microsoft-experimental
...
meson install -C build --destdir "$pkgdir"
(
local libdir=usr/lib icddir=usr/share/vulkan/icd.d
cd "$pkgdir"
...
_pick dozen $icddir/dzn_icd*.json
_pick dozen $libdir/libvulkan_dzn.so*
_pick docs usr/share/doc
...
)
package_vulkan-dozen() {
pkgdesc="Microsoft dozen drivers"
depends=(
expat
gcc-libs
glibc
libdrm
libelf
libx11
libxcb
libxshmfence
llvm-libs
zlib
zstd
)
mv dozen/* "$pkgdir"
...
} ▸ VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/dzn_icd.x86_64.json vulkaninfo
WARNING: dzn is not a conformant Vulkan implementation, testing use only.
Dropped Escape call with ulEscapeCode : 0x03007703
MESA: error: ID3D12DeviceFactory::CreateDevice failed
ERROR: [../mesa-24.2.2/src/microsoft/vulkan/dzn_device.c:1134] Code 0 : VK_ERROR_INITIALIZATION_FAILED
ERROR: [Loader Message] Code 0 : setup_loader_term_phys_devs: Call to 'vkEnumeratePhysicalDevices' in ICD /usr/lib/libvulkan_dzn.so failed with error code -3
ERROR: [Loader Message] Code 0 : setup_loader_term_phys_devs: Failed to detect any valid GPUs in the current config
ERROR at /usr/src/debug/vulkan-tools/Vulkan-Tools-1.3.269/vulkaninfo/./vulkaninfo.h:237:vkEnumeratePhysicalDevices failed with ERROR_INITIALIZATION_FAILED ▸ glxinfo -B
name of display: :0
WARNING: dzn is not a conformant Vulkan implementation, testing use only.
Dropped Escape call with ulEscapeCode : 0x03007703
MESA: error: ID3D12DeviceFactory::CreateDevice failed
WARNING: dzn is not a conformant Vulkan implementation, testing use only.
Dropped Escape call with ulEscapeCode : 0x03007703
MESA: error: ID3D12DeviceFactory::CreateDevice failed
WARNING: dzn is not a conformant Vulkan implementation, testing use only.
Dropped Escape call with ulEscapeCode : 0x03007703
MESA: error: ID3D12DeviceFactory::CreateDevice failed
WARNING: dzn is not a conformant Vulkan implementation, testing use only.
Dropped Escape call with ulEscapeCode : 0x03007703
MESA: error: ID3D12DeviceFactory::CreateDevice failed
Dropped Escape call with ulEscapeCode : 0x03007703
Dropped Escape call with ulEscapeCode : 0x03007703
display: :0 screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
Vendor: Mesa (0xffffffff)
Device: llvmpipe (LLVM 18.1.8, 256 bits) (0xffffffff)
Version: 24.2.2
Accelerated: no
Video memory: 15931MB
Unified memory: yes
Preferred profile: core (0x1)
Max core profile version: 4.5
Max compat profile version: 4.5
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.2
Memory info (GL_ATI_meminfo):
VBO free memory - total: 21 MB, largest block: 21 MB
VBO free aux. memory - total: 15278 MB, largest block: 15278 MB
Texture free memory - total: 21 MB, largest block: 21 MB
Texture free aux. memory - total: 15278 MB, largest block: 15278 MB
Renderbuffer free memory - total: 21 MB, largest block: 21 MB
Renderbuffer free aux. memory - total: 15278 MB, largest block: 15278 MB
Memory info (GL_NVX_gpu_memory_info):
Dedicated video memory: 4294020543 MB
Total available memory: 4294036475 MB
Currently available dedicated video memory: 21 MB
OpenGL vendor string: Mesa
OpenGL renderer string: llvmpipe (LLVM 18.1.8, 256 bits)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 24.2.2-arch1.1
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.2.2-arch1.1
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.2.2-arch1.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20 ▸ vkcube
WARNING: dzn is not a conformant Vulkan implementation, testing use only.
Dropped Escape call with ulEscapeCode : 0x03007703
MESA: error: ID3D12DeviceFactory::CreateDevice failed
WARNING: dzn is not a conformant Vulkan implementation, testing use only.
Dropped Escape call with ulEscapeCode : 0x03007703
MESA: error: ID3D12DeviceFactory::CreateDevice failed
WARNING: dzn is not a conformant Vulkan implementation, testing use only.
Dropped Escape call with ulEscapeCode : 0x03007703
MESA: error: ID3D12DeviceFactory::CreateDevice failed
WARNING: dzn is not a conformant Vulkan implementation, testing use only.
Dropped Escape call with ulEscapeCode : 0x03007703
MESA: error: ID3D12DeviceFactory::CreateDevice failed
WARNING: dzn is not a conformant Vulkan implementation, testing use only.
Dropped Escape call with ulEscapeCode : 0x03007703
MESA: error: ID3D12DeviceFactory::CreateDevice failed
WARNING: dzn is not a conformant Vulkan implementation, testing use only.
Dropped Escape call with ulEscapeCode : 0x03007703
MESA: error: ID3D12DeviceFactory::CreateDevice failed
WARNING: dzn is not a conformant Vulkan implementation, testing use only.
Dropped Escape call with ulEscapeCode : 0x03007703
MESA: error: ID3D12DeviceFactory::CreateDevice failed
WARNING: dzn is not a conformant Vulkan implementation, testing use only.
Dropped Escape call with ulEscapeCode : 0x03007703
MESA: error: ID3D12DeviceFactory::CreateDevice failed
Selected GPU 0: llvmpipe (LLVM 18.1.8, 256 bits), type: Cpu |
Hi, I have been trying to setup vulkan on my WSL2 Arch Linux instance, I installed the vulkan-devel package and ran vulkaninfo which gave the following output:
I checked if WSL can see my GPU by running glxinfo -B and the output verified that my discrete GPU is recognised:
After doing some research, I found some reports suggesting there is D3D12 -> Vulkan in Mesa drivers from some time now but I did not find any official Microsoft source to confirm this.
Hence I want to ask is Vulkan properly supported in WSL2 + WSLg? If so, are there official docs on this?
The text was updated successfully, but these errors were encountered: