roderickc / wine-vulkan

Other
53 stars 7 forks source link

Can add support for wine-vulkan on Android.. #12

Open oscarbg opened 6 years ago

oscarbg commented 6 years ago

Hi, just discovered recently since Wine 3.0 they have Android support and provide precompiled APKs for arm and x86 targets..((https://dl.winehq.org/wine-builds/android) of course ARM target not much use right now as can't use QEMU to run x86 Windows apps and Windows RT apps that are supported don't support Vulkan.. but x86 builds is the more interesting as it allow running Windows apps (right now 32bit apps) on Android x86 devices like most PCs/laptops using ISOs from http://www.android-x86.org/.. in fact I tested and it works perfectly fine on a Oreo 8.1 experimental build provided by @maurossi https://drive.google.com/drive/folders/0B_OFHiIqgpSFTFpkQWc1eXV3ME0 latest build works very nice with RX Vega (has all AMDGPU DC bits and latest kernel 4.15 + Mesa18.1+LLVM6.0) right now I got Wine Android working nicely installing Win32 apps right Notepad++,WinRAR,7-zip,etc.. It worked nice on Intel HD530 (on Vega Winde Android has some render issues) no pressure to mauro but seems he is close to having Vulkan Android x86 ISO ready with ANV for Intel iGPUs and RADV for AMD GPU up to Vega (https://github.com/maurossi/mesa/commits/18.1.0-devel_w06) so would be nice if you can add support for Vulkan on Wine Android builds so using jointly with coming soon Android x86 Vulkan enabled ISOs we can run Windows apps on Android x86.. In fact if we get a Wine android x86_64 APK with your Vulkan support and using Mauro ISOs with RADV+Vega support Wolfenstein II/Doom64/RPCS3 should work on Android x86 ISOs.. also then installing DXVK on Wine Android we could even run DX11 games/apps on Android x86 like currently running under RADV Tomb Raider/Unigine Heaven/Valley etc.. just trying to motivate you to investigate adding Vulkan to Wine Android also.. Just pointing (https://joshumax.github.io/general/2018/01/19/building-wine-3-0-on-android.html) seems to provide to compile instructions for Wine 3.x for Android) thanks..

roderickc commented 6 years ago

Vulkan support can be added for Android at some point. Currently my time however is limited and my main priority is getting my vulkan code into regular Wine. Once that is in, maybe I will take a stab at some point, but no promises.

maurossi commented 6 years ago

Hi,

I just wanted to inform you that experimental builds of android-x86 have barely anv, radv build successful without building errors but they are not yet in working state.

anv should support Vulkan HAL for Android and is "seen" by Vulkan Caps Viewer, but I haven't seen any demo/app producing output on screen (just black window) deqp VK tests can be launched and a percentage passes, but on Intel HD 530 (Skylake GT2) I see no rendering.

I'm trying with Sascha Willems vulkanGears for arm, we have native bridge emulation, but I'm getting some error related to vkCreateImage w/ native buffer failed

02-04 22:17:30.488 17909 17926 D vndksupport: Loading /vendor/lib/hw/ vulkan.android-x86.so from current namespace instead of sphal namespace. 02-04 22:17:30.494 17909 17926 D vulkan : searching for layers in '/data/app/de.saschawillems.vulkanGears-UIPHJD-_5iIwRtdsb3ZFPA==/lib/arm' 02-04 22:17:30.494 17909 17926 D vulkan : searching for layers in '/system/fake-libs' 02-04 22:17:30.495 17909 17926 D vulkan : searching for layers in '/data/app/de.saschawillems.vulkanGears-UIPHJD-_5iIwRtdsb3ZFPA==/base.apk!/lib/armeabi-v7a' ... 02-04 22:17:30.499 17909 17926 I vulkanandroid: Loading instance based function pointers... ... 02-04 22:17:30.526 2690 2712 I ActivityManager: Displayed de.saschawillems.vulkanGears/android.app.NativeActivity: +550ms 02-04 22:17:30.558 17909 17926 D vulkanExample: androidProduct = Default string Default string 02-04 22:17:30.566 17909 17926 I de.saschawillems.vulkanGears: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0 02-04 22:17:30.566 17909 17926 I de.saschawillems.vulkanGears: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0 02-04 22:17:30.572 17909 17926 D vndksupport: Loading /vendor/lib/hw/ android.hardware.graphics.mapper@2.0-impl.so from current namespace instead of sphal namespace. 02-04 22:17:30.573 17909 17926 D vndksupport: Loading /vendor/lib/hw/ gralloc.drm.so from current namespace instead of sphal namespace. 02-04 22:17:30.575 17909 17926 D GRALLOC-DRM: drmOpen i915: 55 02-04 22:17:30.576 17909 17926 I GRALLOC-DRM: create intel for driver i915 02-04 22:17:30.576 17909 17926 D vulkan : vkCreateImage w/ native buffer failed: 3294895293 02-04 22:17:30.578 17909 17926 F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 17926 (ems.vulkanGears), pid 17909 (ems.vulkanGears) 02-04 22:17:30.636 17933 17933 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone 02-04 22:17:30.637 2597 2597 I /system/bin/tombstoned: received crash request for pid 17909 02-04 22:17:30.637 17933 17933 I crash_dump32: performing dump of process 17909 (target tid = 17926) 02-04 22:17:30.638 17933 17933 F DEBUG :


02-04 22:17:30.638 17933 17933 F DEBUG : Build fingerprint: 'Android-x86/android_x86_64/x86_64:8.1.0/OPM1.171019.011/utente02041647:eng/test-keys' 02-04 22:17:30.638 17933 17933 F DEBUG : Revision: '0' 02-04 22:17:30.638 17933 17933 F DEBUG : ABI: 'x86' 02-04 22:17:30.638 17933 17933 F DEBUG : pid: 17909, tid: 17926, name: ems.vulkanGears >>> de.saschawillems.vulkanGears <<< 02-04 22:17:30.638 17933 17933 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 02-04 22:17:30.638 17933 17933 F DEBUG : Cause: null pointer dereference 02-04 22:17:30.638 17933 17933 F DEBUG : eax 00000000 ebx e8921ea8 ecx ded96d80 edx dc1b6800 02-04 22:17:30.638 17933 17933 F DEBUG : esi 00000000 edi 00000000 02-04 22:17:30.638 17933 17933 F DEBUG : xcs 00000023 xds 0000002b xes 0000002b xfs 0000006b xss 0000002b 02-04 22:17:30.638 17933 17933 F DEBUG : eip e89159c1 ebp ce894798 esp ce894770 flags 00010292 02-04 22:17:30.639 17933 17933 F DEBUG : 02-04 22:17:30.639 17933 17933 F DEBUG : backtrace: 02-04 22:17:30.640 17933 17933 F DEBUG : #00 pc 000159c1 /android/system/lib/libvulkan.so 02-04 22:17:30.640 17933 17933 F DEBUG : #01 pc 0000e220 /android/system/lib/libvulkan.so 02-04 22:17:30.640 17933 17933 F DEBUG : #02 pc 00222366 /android/system/lib/libhoudini.so 02-04 22:17:30.640 17933 17933 F DEBUG : #03 pc 00002b9f /system/lib/arm/nb/libvulkan.so

utente@utente-Terabyte:~/oreo-x86_kernel_test$ addr2line -Cfe out/target/product/x86/symbols/system/lib/libvulkan.so 000159c1 ANativeWindowBuffer::incStrong(void const) const frameworks/native/libs/nativebase/include/nativebase/nativebase.h:78 0000e220 vulkan::api::(anonymous namespace)::GetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice_T, unsigned long long, unsigned int, VkSurfaceFormatKHR) frameworks/native/vulkan/libvulkan/api_gen.cpp:1189

2018-02-14 18:15 GMT+01:00 roderickc notifications@github.com:

Vulkan support can be added for Android at some point. Currently my time however is limited and my main priority is getting my vulkan code into regular Wine. Once that is in, maybe I will take a stab at some point, but no promises.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/roderickc/wine-vulkan/issues/12#issuecomment-365678858, or mute the thread https://github.com/notifications/unsubscribe-auth/AH9VlMfzk9e3_I2zPUW2mfjTvZ-6BulRks5tUxTNgaJpZM4SB0DU .

oscarbg commented 6 years ago

@maurossi Mauro just sent mail with PPSSPP Android Vulkan testing on HD530 just showing similar "vkCreateImage w/ native buffer failed" but PPSSPP is native x86 Vulkan app (not free anymore on play store see mail but on apkmirror) and PPSSPP provides much more detailed Vulkan logs showing how failure occurs seems.. should be comparable to logs on Ubuntu build using PPSSPP+Anv driver to see Vulkan initialization diffs..

finally good news PPSSPP is also on Windows with Vulkan support so should be testable on Wine Vulkan Android once support is there..

oscarbg commented 6 years ago

@roderickc no pressure.. just pointing the issue and for if also someone want to take the challenge :-)

maurossi commented 6 years ago

Hi,
more than an issue, this is an RFC and a very interesting feature.

In the meantime vulkan anv and vulkan radv have been enabled and are reasonably stable, considering my mid-low expertise.

https://sourceforge.net/p/android-x86/opengles/10/

https://groups.google.com/forum/#!topic/android-x86/tHgxQEaJpvQ

vulkan.android-x86.so and vulkan.radv.so are installed to /vendor/lib64/hw and /vendor/lib/hw

In oreo-x86 experimental build, init.sh init_hal_vulkan() sets ro.hardware.vulkan property according to the loaded drmfb module, for available vulkan hals:

for inteldrmfb setprop ro.hardware.vulkan android-x86 for amdgpudrmfb setprop ro.hardware.vulkan radv

I don't know how you wrap the vulkan libs in linux, but these are the current specs in oreo-x86. Mauro