wgpu: Executable cross-compiled from Linux to Windows will not run on Wine
Description Executable cross-compiled from Linux to Windows will not run on Wine. Memory types offered by Wine are not compatible with what WGPU wants.
fixme:vkd3d_allocate_device_memory: Failed to find suitable memory type (allowed types 0x82).
Here’s the Vulkan spec for those bits.
I realize this is likely to result in finger-pointing between the WGPU side (“Wine doesn’t support the memory type we want”) and the Wine side (“WGPU should be more flexible in the types of memory it accepts.”) The NVidia position is stated here: Discussion by NVidia: “A memory allocator that follows the rules and guidance of the Vulkan specification should be able to handle all these memory types gracefully by properly interpreting the VkMemoryRequirements::memoryTypeBits member when selecting an allocation for a specific resource.”
Repro steps
- Install current Rust on Ubuntu Linux (20.04 LTS used).
- Install current Wine (6.0.1) or use Wine 5 that ships with 20.04 LTS.
- Install Rust target for x86_64-pc-windows-gnu
- Build WGPU examples for that target, debug mode.
- wine cube.exe
Expected vs observed behavior Expected cube to appear in a window. Got errors. See attachment.
Extra materials Screenshots to help explain your problem. Validation logs can be attached in case there are warnings and errors. Zip-compressed API traces and GPU captures can also land here.
Platform
Information about your OS, version of wgpu
, your tech stack, etc.
Ubuntu 20.04 LTS. Tried two different machines, one with Wine 6.0.1 (current stable) and one with the Wine 5 that ships with Ubuntu.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 32 (8 by maintainers)
WGPU people, here’s the Wine bug report: https://bugs.winehq.org/show_bug.cgi?id=51662 There’s no code here by me. You guys work it out.
Cool, so that sounds like everything here is resolved. I don’t think there’s really any bugs left (besides “stable distributions are shipping too-old versions”, which doesn’t really sound like much of a bug).
Actually, now that I think about it, I probably had native d3dcompiler in the prefix by accident.
For what it’s worth, I don’t think the situation is nearly that bad. Plenty of d3d11 games run already, especially now that deferred contexts are implemented upstream. I won’t pretend that wined3d doesn’t have some pretty huge glaring problems when it comes to performance, but the nice thing is that I think we really are close to supporting that well upstream (in fact I’m working on it right now as we speak).
@kvark
Thanks! Yeah, that helped with testing. 👍
Setting
WGPU_BACKEND=dx12
worked for my win10 box, so my HP with IGPU might not have a working vulkan setup then, since it was not default selected like it was on my GTX970 adapter.Using wine-staging-6.14 + vkd3d @ a08d99e0265deeaad80c43f62738399b9203157a did not work for me, neither did vkd3d-proton either when using
WGPU_BACKEND=dx12
.For some odd reason, wine-6.0.1 does not seem to work with vulkan when using
WGPU_BACKEND=vulkan
for me, so i need to investigate that a bit… Running Shadertoy/seascape from the GeexLAB package works using wine-6.0.1 tho, so not sure why this wgpu thing would fail.@zfigura Is it worth investigating this with vkd3d? Running
WGPU_BACKEND=dx12 wine ./wgpu-cube.exe
does seem to force using vkd3d and create some useful logs.