T42 | <TheVancedGamer> hm, not sure who to specifically ask so i'm asking here, how does SFOS work with Vulkan? the vulkan libraries created by libhybris build are installed, but I also see vulkan-ioader which replaces those, in any case vulkaninfo still doesn't see the GPU for me | 05:35 |
---|---|---|
T42 | <TheVancedGamer> mal: does vulkan work at all? I'm trying to get it work, made an icd with libvulkan.so.1, and now it OOMs | 06:39 |
mal | @TheVancedGamer at least the test_vulkan in libhybris-tests works, also the sdl test program works | 10:36 |
mal | @TheVancedGamer do not use the vulkan-loader, just link to libvulkan | 10:37 |
mal | I tried to make the libhybris code the icd way but it didn't work so I made it a full library | 10:38 |
mal | this is an example how to use vulkan https://github.com/libhybris/libhybris/blob/master/hybris/tests/test_vulkan.cpp | 10:40 |
mal | well at least vulkan-loader should not be installed on device, I think it can be used during build | 10:45 |
mal | because vulkan pkgconfig file is in that package | 10:45 |
T42 | <TheVancedGamer> mal: I am not using vulkan-loader, test_vulkan doesn't work for me either | 10:48 |
T42 | <TheVancedGamer> so then how do I use vulkan? Was making an icd for it a bad idea? | 10:48 |
mal | which device? | 10:51 |
T42 | <TheVancedGamer> fp4 | 10:51 |
mal | are you also doing a port for it? | 10:52 |
T42 | <TheVancedGamer> test_vulkan works with llvmpipe, but without it I get | 10:52 |
T42 | <TheVancedGamer> ``` | 10:52 |
T42 | <TheVancedGamer> Found 2 instance extensions | 10:52 |
T42 | <TheVancedGamer> Failure at 530 test_vulkan.cpp with result -9``` | 10:52 |
T42 | <TheVancedGamer> mal: no, this is UT | 10:52 |
mal | let me boot my fp4 and test vulkan on it | 10:52 |
mal | wondering who is that group of people doing a parallel port fp4 | 10:53 |
T42 | <TheVancedGamer> for ubuntu touch? | 10:53 |
mal | for sailfish | 10:53 |
T42 | <TheVancedGamer> ah nah, this is on ubuntu touch | 10:54 |
T42 | <TheVancedGamer> I knew you had FP4 working on hybris-20 so didn't bother with SFOS | 10:54 |
mal | I have almost fully working port and then some people made a PR to one repo suggesting they are working on a port also | 10:54 |
T42 | <TheVancedGamer> no idea about that | 10:54 |
mal | btw, test_vulkan works fine on my fp4 running hybris-20 based sailfish | 10:54 |
T42 | <TheVancedGamer> I think something is wrong here | 10:55 |
mal | strace it | 10:55 |
T42 | <TheVancedGamer> so I used latest vulkan-headers (as in my issue), compiled and installed libhybris (without any icd pointing to it) and all vulkan apps complain about missing driver | 10:55 |
mal | what did you really mean when you said you made an icd for it | 10:55 |
T42 | <TheVancedGamer> like the icd json | 10:55 |
mal | well libhybris is not an icd | 10:56 |
T42 | <TheVancedGamer> that points to the vulkan library | 10:56 |
T42 | <TheVancedGamer> I couldn't figure out how to use it so I tried doing that | 10:56 |
mal | build your vulkan app using pkgconfig(vulkan) as dependency, on device you only should have libhybris installed, not vulkan-loader | 10:57 |
T42 | <TheVancedGamer> only have libhybris, vulkan-loader is not installed | 10:57 |
T42 | <TheVancedGamer> only trying to get vulkaninfo to output anything rn | 10:57 |
T42 | <TheVancedGamer> stracing test_vulkan seems to suggest it's searching for an icd.d config | 10:58 |
mal | I'll check | 10:58 |
mal | my strace doesn't mention anything about icd | 11:00 |
mal | which library does it load? | 11:00 |
T42 | <TheVancedGamer> let me pull up strace on desktop | 11:00 |
T42 | <TheVancedGamer> uhh, I got a different issue on ssh | 11:02 |
T42 | <TheVancedGamer> connect(3, {sa_family=AF_UNIX, sun_path="/run/user/32011/wayland-0"}, 28) = 0 | 11:03 |
T42 | <TheVancedGamer> sendmsg(3, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\1\0\0\0\1\0\f\0\2\0\0\0", iov_len=12}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, MSG_DONTWAIT|MSG_NOSIGNAL) = 12 | 11:03 |
T42 | <TheVancedGamer> ppoll([{fd=3, events=POLLIN}], 1, NULL, NULL, 0) = 1 ([{fd=3, revents=POLLIN|POLLERR|POLLHUP}]) | 11:03 |
T42 | <TheVancedGamer> recvmsg(3, {msg_namelen=0}, MSG_DONTWAIT|MSG_CMSG_CLOEXEC) = -1 ECONNRESET (Connection reset by peer) | 11:03 |
T42 | <TheVancedGamer> oops, should've pasted on a pastebin | 11:03 |
T42 | <TheVancedGamer> mal: https://paste.myself5.de/elexekuxey.yaml | 11:06 |
T42 | <TheVancedGamer> it does in fact load libvulkan.so.1 (from libhybris) but I get nothing | 11:06 |
mal | I still didn't quite understand where you put that icd you mentioned | 11:12 |
T42 | <TheVancedGamer> /usr/share/vulkan/icd.d/hybris_icd.aarch64.json | 11:12 |
T42 | <TheVancedGamer> in there I just copied the llvmpipe icd and replaced the lib with libhybris one, which OOMed device, but now i've removed it | 11:13 |
mal | I think the issue I had with icd indeed was and endless loop because android side also does a bit of a icd internally | 11:14 |
T42 | <TheVancedGamer> hmm, right now I really have no idea | 11:14 |
mal | have you patches libhybris in any way? | 11:15 |
mal | *patched | 11:15 |
T42 | <TheVancedGamer> hmm, nothing to vulkan bits | 11:15 |
T42 | <TheVancedGamer> some patches for ubuntu touch packaging though | 11:15 |
T42 | <TheVancedGamer> I still don't quite understand how programs are supposed to use libhybris vulkan | 11:18 |
mal | I mentioned it already, you link regularly against vulkan i.e. vulkan-headers and vulkan-loader, on device you have libhybris-libvulkan instead which is supposed to be same as vulkan-loader | 11:27 |
mal | you have no other vulkan libs on the device? and you are really sure that libvulkan.so.1 is from libhybris? | 11:27 |
T42 | <TheVancedGamer> mal: yep, checked output of `dpkg -L`, and in general it is from libhybtis | 11:37 |
T42 | <TheVancedGamer> libhybris* | 11:37 |
mal | what could be doing that icd then | 11:55 |
T42 | <TheVancedGamer> as I said, I added it to test and then removed it | 11:58 |
mal | but you still see it in strace? | 12:00 |
T42 | <TheVancedGamer> nope, I see it trying to find icd's in strace | 12:02 |
T42 | <TheVancedGamer> not sure if you saw this but here https://paste.myself5.de/elexekuxey.yaml | 12:02 |
mal | there is nothing about libhybris linker in that | 12:06 |
T42 | <TheVancedGamer> it is strace of test_vulkan | 12:07 |
T42 | <TheVancedGamer> it loads libvulkan.so.1 which is provided by libhybris | 12:07 |
mal | libhybris should be loading the android libvulkan.so | 12:08 |
mal | via libhybris.so.1 | 12:09 |
T42 | <TheVancedGamer> hmm, didn't know that | 12:09 |
mal | https://github.com/libhybris/libhybris/blob/master/hybris/vulkan/vulkan.c#L52 | 12:13 |
T42 | <TheVancedGamer> is this libvulkan.so supposed to be in vendor? | 12:14 |
T42 | <TheVancedGamer> I found it in /system/{lib,lib64} | 12:15 |
T42 | <TheVancedGamer> hm, something is broken definitely | 12:17 |
T42 | <TheVancedGamer> oh god, i'm so stupid | 12:19 |
T42 | <TheVancedGamer> libvulkan.so.1 comes from libvulkan1 package | 12:19 |
T42 | <TheVancedGamer> sorry mal | 12:19 |
T42 | <TheVancedGamer> now test_vulkan wants libvulkan.so.1 | 12:22 |
mal | so you had the vulkan-loader installed? | 12:23 |
mal | do you now have libhybris vulkan package installed? | 12:23 |
T42 | <TheVancedGamer> vulkan-loader and libvulkan1 are completely different, hmm | 12:23 |
T42 | <TheVancedGamer> mal: there's a libhybris vulkan package? | 12:23 |
mal | yes, if you build it | 12:24 |
T42 | <TheVancedGamer> hm, where does the .so end up from build? | 12:24 |
T42 | <TheVancedGamer> I might need to adjust deb packaging | 12:24 |
mal | https://github.com/mer-hybris/libhybris/blob/master/rpm/libhybris.spec#L222 | 12:24 |
mal | https://github.com/mer-hybris/libhybris/blob/master/rpm/libhybris.spec#L502 | 12:25 |
mal | @TheVancedGamer vulkan-loader provides libhybris.so.1, that libhybris one just replaces it in hybris based devices | 12:26 |
mal | @TheVancedGamer where is the libhybris deb packagin? | 12:54 |
T42 | <TheVancedGamer> mal: gitlab.com/ubports/development/core/packaging/libhybris | 12:56 |
T42 | <TheVancedGamer> i'm updating it to latest snapshot rn | 12:56 |
mal | I just merged some PRs to libhybris yesterday | 12:56 |
T42 | <TheVancedGamer> it's okay, i'll get it in | 12:57 |
T42 | <TheVancedGamer> I think you merged the vulkan issue and one other PR iirc | 12:57 |
mal | yes | 12:57 |
mal | I should update vulkan headers for sailfish also | 12:57 |
T42 | <TheVancedGamer> that's probably why it compiled fine on sailfish | 12:58 |
mal | yes | 12:58 |
T42 | <TheVancedGamer> reminds me I need to pull latest libhybris and get rid of my comments | 12:58 |
mal | I haven't updated those for a while partially because no devices needed vulkan 1.3 yet | 12:58 |
mal | I will probably add any missing things to libhybris vulkan support when I do that | 13:00 |
mal | probably 1.2 based devices are fine now | 13:00 |
mal | only some very high end new devices have 1.3 | 13:01 |
T42 | <TheVancedGamer> mal: after installing the libraries provided by libhybris, test_vulkan and vulkaninfo are not segfaulting | 13:13 |
T42 | <TheVancedGamer> https://paste.myself5.de/jabahawatu.yaml | 13:14 |
T42 | <TheVancedGamer> I tried with sudo (in case the build.prop issue was fatal) but nope | 13:14 |
mal | what are the permissions of that file? | 13:15 |
T42 | <TheVancedGamer> sorry, I meant test_vulkan and vulkaninfo ARE segfaulting | 13:15 |
T42 | <TheVancedGamer> libvulkan*? | 13:15 |
T42 | <TheVancedGamer> -rwxr-xr-x, owned by root | 13:15 |
mal | I mean that property file | 13:16 |
T42 | <TheVancedGamer> -rw-------., owned by root as well | 13:16 |
T42 | <TheVancedGamer> as I said, after running with sudo it does open and read the file, but segfaults shortly after | 13:16 |
mal | pretty sure graphics are not even supposed to work as root | 13:17 |
mal | because of wayland stuff etc | 13:17 |
mal | I mean apps | 13:17 |
T42 | <TheVancedGamer> yeah, but why does it segfault as user? | 13:18 |
T42 | <TheVancedGamer> and anyway to debug? strace looks unhelpful to me | 13:18 |
mal | what does gdb say? | 13:18 |
mal | have you tried to every permissions to that .prop file | 13:18 |
T42 | <TheVancedGamer> it's owned by android container, that might die | 13:19 |
T42 | <TheVancedGamer> i'll try though | 13:19 |
mal | how do other things handle that | 13:19 |
T42 | <TheVancedGamer> most things use getprop | 13:20 |
T42 | <TheVancedGamer> "/sbin/ldconfig.real: /lib/aarch64-linux-gnu/libvulkan.so.1 is not a symbolic link" | 13:20 |
T42 | <TheVancedGamer> hmm | 13:20 |
T42 | <TheVancedGamer> it is indeed not, but why it it complaining? | 13:20 |
T42 | <TheVancedGamer> mal: and /system is mounted as ro in ramdisk | 13:21 |
T42 | <TheVancedGamer> and write-protected | 13:21 |
mal | libhybris vulkan code is not doing any prop things | 13:21 |
T42 | <TheVancedGamer> I installed gdb, now how do I use it? :P | 13:22 |
mal | can you test some other test_* from libhybris, do those work? | 13:23 |
T42 | <TheVancedGamer> test_dlopen works | 13:23 |
T42 | <TheVancedGamer> so does test_egl{_configs} | 13:23 |
mal | do those do any prop stuff in strace | 13:23 |
T42 | <TheVancedGamer> `openat(AT_FDCWD, "/system/build.prop", O_RDONLY) = -1 EACCES (Permission denied)` in test_dlopen | 13:25 |
T42 | <TheVancedGamer> yet still works | 13:25 |
mal | so gdb time | 13:26 |
T42 | <TheVancedGamer> ok | 13:27 |
T42 | <TheVancedGamer> except I never learned my way across gdb, time for man pages on google | 13:27 |
mal | try HYBRIS_ENABLE_LINKER_DEBUG_MAP=1 gdb test_vulkan | 13:27 |
mal | and then run, and once it crashes thread apply all bt | 13:28 |
T42 | <TheVancedGamer> thx | 13:29 |
T42 | <TheVancedGamer> ``` | 13:30 |
T42 | <TheVancedGamer> | 13:30 |
T42 | <TheVancedGamer> gdb) thread apply all bt | 13:30 |
T42 | <TheVancedGamer> | 13:30 |
T42 | <TheVancedGamer> Thread 1 (process 62932): | 13:30 |
T42 | <TheVancedGamer> #0 0x0000007ff7b6e540 in ?? () | 13:31 |
T42 | <TheVancedGamer> Backtrace stopped: previous frame identical to this frame (corrupt stack?)``` | 13:31 |
T42 | <TheVancedGamer> hmm, am I missing something here? | 13:31 |
mal | probably crashes in android side | 13:31 |
mal | does logcat tell anythint | 13:31 |
T42 | <TheVancedGamer> nothing in logcat | 13:32 |
mal | have you tried strace -Ff -s2048 test_vulkan | 13:34 |
mal | just to be sure it sees all threads | 13:34 |
mal | and forks etc | 13:34 |
T42 | <TheVancedGamer> mal: nothing changed | 13:36 |
T42 | <TheVancedGamer> strace is same as before | 13:36 |
mal | very odd | 13:38 |
T42 | <TheVancedGamer> indeed | 13:39 |
mal | any chance of see what that pointer could be | 13:40 |
T42 | <TheVancedGamer> mal: can't seem to find any references to it | 13:58 |
T42 | <elros34> @TheVancedGamer have you checked /proc/pid/maps to see in which library it crash? | 19:26 |
Generated by irclog2html.py 2.17.1 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!