Closed AreamanM closed 3 weeks ago
If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.
Please 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!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
/question
Transferred to WSLg repo!
There is a vulkan driver called dozen which run on d3d12 in mesa source package.
It's incomplete, but usable in WSL2.
But offical Arch mesa did not contains the driver, you have to build and repack mesa yourself.
change the mesa PKGBUILD from
-D vulkan-drivers=amd,intel,intel_hasvk,swrast,virtio,nouveau
to
-D vulkan-drivers=amd,intel,intel_hasvk,swrast,virtio,nouveau,microsoft-experimental
and add the package function.
That's the result:
$ vkcube
WARNING: dzn is not a conformant Vulkan implementation, testing use only.
WARNING: dzn is not a conformant Vulkan implementation, testing use only.
Selected GPU 0: Microsoft Direct3D12 (NVIDIA GeForce RTX 4060 Laptop GPU), type: DiscreteGpu
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
and add the package function.
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.
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?