mesa-dist-win icon indicating copy to clipboard operation
mesa-dist-win copied to clipboard

How to run Vulkan applications with Mesa on Windows?

Open retrooper opened this issue 4 years ago • 13 comments
trafficstars

The main reason I want to use Mesa drivers on windows, is so I can run vulkan applications. I will always get a "vulkan-1.dll not found", because my Intel drivers have not implemented Vulkan support. On linux mesa drivers were easy to setup and I can run all types of applications. I tried extracting the mesa3d-msvc zip in the releases section, ran the "perappdeploy.cmd" script, and it only seemed to make OpenGL drivers available. How can I use vulkan drivers, and can we just add vulkan-1.dll inside my System folder on windows so all applications can use it, cause I don't have any vulkan drivers. I want all vulkan applications to use Mesa.

retrooper avatar May 05 '21 08:05 retrooper

I don't only want to be able to run vulkan applications, I want to do vulkan application development myself. I am doing it on linux atm, thats the main reason I switched over to linux, but I want to switch back to windows.

retrooper avatar May 05 '21 08:05 retrooper

You have to install Vulkan runtime first, then you can either point VK_ICD_FILENAMES to lavapipe JSON or create Vulkan slots to your GPU driver. See Vulkan ICD discovery documentation.

pal1000 avatar May 05 '21 14:05 pal1000

How can I install vulkan-swrast(lavapipe) on Windows?

retrooper avatar May 05 '21 16:05 retrooper

You can try 21.1-rc1 MSVC package. It contains x64 lavapipe. Extract it and then follow the instructions from my last comment. Note that you won't find lavapipe in 21.0.3 or in 21.1-rc1 MinGW package. I may consider making another Mesa 21.1 release candidate once this fix gets incorporated.

pal1000 avatar May 05 '21 21:05 pal1000

Wait will it then end up using my CPU instead, as it seems like its a CPU implementation, id prefer if it used my GPU tho

retrooper avatar May 06 '21 05:05 retrooper

Unfortunately on hardware acceleration front only RADV AMD GPU Vulkan driver has Windows support, but it won't be available until 21.2 and it's not in a usable state yet.

pal1000 avatar May 06 '21 08:05 pal1000

So CPU is my only option on Windows? If thats the case, I think I'll have to scratch my plan of moving to windows.

retrooper avatar May 07 '21 19:05 retrooper

I'm encountering a similar issue when trying to run Godot 4.0alpha in a Windows 7 64-bit VM[^1] (which requires both Vulkan and OpenGL libraries to be installed). 3D acceleration is disabled in the VirtualBox settings, but guest additions are installed.

I've installed the Vulkan SDK 1.3.211.0 and mesa-dist-win 22.1.1 (MinGW). I've tried system-wide deployment and rebooted, but it didn't work, even for OpenGL-only applications like Sauerbraten.

I went and tried manual local deployment instead, to no avail:

  • I placed opengl32.dll, libgallium_wgl.dll, vulkan_lvp.dll and lvp_icd.x86_64.json in the same folder as the executable I'm trying to run.
  • I open a command prompt, cd to the folder in question and run: set VK_ICD_FILENAMES=C:\Users\Hugo\Downloads\lvp_icd.x86_64.json
  • I run the executable in the command prompt.
  • I get this error: "The program can't start because vulkan-1.dll is missing from your computer. …"

[^1]: I can't use Windows 10 or later here, as I'm testing behavior of specific code on Windows versions older than 10. I could use a Windows 8.1 VM if it's the only solution, still.

Calinou avatar Jun 13 '22 15:06 Calinou

@Calinou see my comment above.

pal1000 avatar Jun 14 '22 10:06 pal1000

for resolve this part you will need vulkan runtime

the vulkan-1.dll is located inside this file both for x32 and x64 VulkanRT-1.3.216.0-Components.zip

just extract the right x32 or x64 version of the vulkan-1.dll and put it inside C:\Users\Hugo\Downloads\

TherealGenius avatar Jun 19 '22 05:06 TherealGenius

This could be helpful

This isn't relevant for use within a virtual machine where there is no actual graphics accelerator to speak of.

Calinou avatar Jun 21 '22 16:06 Calinou