gfx-rs / portability

Vulkan Portability Implementation
Mozilla Public License 2.0
384 stars 25 forks source link

Issue running cube.exe from Vulkan SDK under Wine.. #151

Closed oscarbg closed 6 years ago

oscarbg commented 6 years ago

Hi, sorry for reporting so much issues.. just testing basic Wine support (that is working with moltenvk) I run (with RPCS3 binary): wine /Volumes/win/VulkanSDK/1.1.82.0/Bin/cube.exe

thread '<unnamed>' panicked at 'Unable to map memory!', /Users/dmalyshau/.cargo/git/checkouts/gfx-e86e7f3ebdbc4218/4a1b551/src/backend/metal/src/device.rs:1503:39
note: Run with `RUST_BACKTRACE=1` for a backtrace.
wine: Assertion failed at address 0x7fff58d319d2 (thread 0009), starting debugger...

with export RUST_BACKTRACE=1

wine /Volumes/win/VulkanSDK/1.1.82.0/Bin/cube.exe 
thread '<unnamed>' panicked at 'Unable to map memory!', /Users/dmalyshau/.cargo/git/checkouts/gfx-e86e7f3ebdbc4218/4a1b551/src/backend/metal/src/device.rs:1503:39
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: std::panicking::rust_panic_with_hook

and with debug variant:

wine /Volumes/win/VulkanSDK/1.1.82.0/Bin/cube.exe 
thread '<unnamed>' panicked at 'Unable to map memory!', /Users/dmalyshau/.cargo/git/checkouts/gfx-e86e7f3ebdbc4218/4a1b551/src/backend/metal/src/device.rs:1503:39
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: std::panicking::rust_panic_with_hook
   5: std::panicking::begin_panic
   6: <gfx_backend_metal::device::Device as gfx_hal::device::Device<gfx_backend_metal::Backend>>::map_memory
   7: portability_gfx::impls::gfxMapMemory
   8: wine_vkMapMemory
fatal runtime error: failed to initiate panic, error 5
0009:fixme:seh:call_stack_handlers calling personality routine in system library not supported yet
0009:fixme:seh:call_stack_handlers calling personality routine in system library not supported yet
wine: Assertion failed at address 0x7fff58d319d2 (thread 0009), starting debugger...
kvark commented 6 years ago

Interesting, thanks for the report! I haven't tried running anything under Wine yet. Are there specific instructions to get Vulkan-compatible Wine on MacOS?

oscarbg commented 6 years ago

I believe (compiled two months ago..) --enable-vulkan in configure is enough.. with that maybe perhaps isn't locating correctly and I vaguely remember it's because it's doing a hardcoded dlopen libMoltenVK.dylib and/or libVulkan.dylib in a file in /winemac.drv folder or in winevulkan folder and really I copied in to multiple locations /lib /usr/lib and /usr/local/lib until it was found..

kvark commented 6 years ago

This should be addressed by #162 which carries https://github.com/gfx-rs/gfx/pull/2380 I didn't verify going through Wine, but running the cube application bundled with LunarG SDK works, and the error was the same.