https://bugs.freedesktop.org/show_bug.cgi?id=89746
Bug ID: 89746 Summary: Mesa and LLVM 3.6+ break opengl for genymotion Product: Mesa Version: 10.5 Hardware: Other OS: All Status: NEW Severity: normal Priority: medium Component: Drivers/Gallium/radeonsi Assignee: dri-devel@lists.freedesktop.org Reporter: spupazza@hotmail.com QA Contact: dri-devel@lists.freedesktop.org
I found out LLVM 3.6 + Mesa 10.5 (and newer) might have some sort of regression breaking opengl with radeonsi drivers at least.
I use genymotion (android emulator) which relies on virtualbox and make use of opengl acceleration. On 2 different machines with 2 different distros (ubuntu 14.10/15.04 and manjaro 0.9 pre4) I had the same problem: as soon as LLVM 3.6 or 3.7git (the latter with utopic when I added paulo dias ppa) gets installed genymotion stop working (the screen of the vm disappear 1-2 seconds after the machine gets started, and while the screen disappear the machine keeps running in the background).
On the terminal I get this error: Port 22468 will be used for OpenGL data connections Unknown TCPCLI command 1003 LLVM ERROR: 'main' label emitted multiple times to assembly file
With LLVM 3.5 genymotion (with the same distros and machines) was working just fine. Another proof that the issue is with LLVM is that as to temporarily sort this problem out, I installed the proprietary drivers (fgrlx) and the issue vanished (since proprietary drivers do not make use of LLVM).
To reproduce the bug, you need a radeon vga (possibly one using the radeonsi drivers so with GCN architecture) , install vitualbox and genymotion, Setup a virtual device and having installed LLVM 3.6 or newer. Then start the device you created.
I reported this bug to the llvm bug-tracker system and they told me to report it to you.
https://bugs.freedesktop.org/show_bug.cgi?id=89746
--- Comment #1 from Ming-Wei Shih xmingske@gmail.com --- I have the exactly the same issue here.
radeonsi + llvm 3.6 gives the exact same error while radeon (and llvm 3.6 installed) or radeonsi + llvm 3.5 never had any issue.
One remark though, it is possible to launch genymotion with the radeonsi + llvm 3.6 combinbation if one tries many times, sometimes it takes 3~5 retries and sometimes 30+. Once started it seems stable.
https://bugs.freedesktop.org/show_bug.cgi?id=89746
--- Comment #2 from Tom Stellard tstellar@gmail.com --- Can you set the environment variable R600_DEBUG=ps,vs,gs when you run genymotion and then post the output.
https://bugs.freedesktop.org/show_bug.cgi?id=89746
--- Comment #3 from giuseppe spupazza@hotmail.com --- I found out that like Ming-Wei Shih reported, if you try several time, sooner or later you'll be able to get the machine started. Unfortunately even then it wasn't stable for me. Here's the output with the variables indicated by stellard (I ran genymotion with : './genymotion R600_DEBUG=ps,vs,gs' command )
[p@pop genymotion]$ ./genymotion Logging activities to file: /home/p/.Genymobile/genymotion.log Logging activities to file: /home/p/.Genymobile/genymotion.log Logging activities to file: /home/p/.Genymobile/Genymotion/deployed/Custom Phone - 4.2.2 - API 17 - 768x1280/genymotion-player.log OpenGL connected to 192.168.56.101:25000 Port 22468 will be used for OpenGL data connections Unknown TCPCLI command 1003 Logging activities to file: /home/p/.Genymobile/genymotion.log Logging activities to file: /home/p/.Genymobile/Genymotion/deployed/Custom Phone - 4.2.2 - API 17 - 768x1280/genymotion-player.log OpenGL connected to 192.168.56.101:25000 Port 22468 will be used for OpenGL data connections Unknown TCPCLI command 1003 Logging activities to file: /home/p/.Genymobile/genymotion.log Logging activities to file: /home/p/.Genymobile/Genymotion/deployed/Custom Phone - 4.2.2 - API 17 - 768x1280/genymotion-player.log OpenGL connected to 192.168.56.101:25000 Port 22468 will be used for OpenGL data connections Unknown TCPCLI command 1003 Unknown TCPCLI command 1003 radeon: Failed to allocate a buffer: radeon: size : 0 bytes radeon: alignment : 4096 bytes radeon: domains : 4 radeon: flags : 4 radeon: Failed to allocate a buffer: radeon: size : 0 bytes radeon: alignment : 4096 bytes radeon: domains : 4 radeon: flags : 4 LLVM failed to compile shader EE si_state_shaders.c:443 si_shader_select - Failed to build shader variant (type=0) -12
https://bugs.freedesktop.org/show_bug.cgi?id=89746
--- Comment #4 from Ilia Mirkin imirkin@alum.mit.edu --- (In reply to giuseppe from comment #3)
(I ran genymotion with : './genymotion R600_DEBUG=ps,vs,gs' command )
I believe the suggestion was to run it was
R600_DEBUG=ps,vs,gs ./genymotion
That way R600_DEBUG is in genymotion's environment. You should expect to see a ton of output.
https://bugs.freedesktop.org/show_bug.cgi?id=89746
--- Comment #5 from Ming-Wei Shih xmingske@gmail.com --- Created attachment 114583 --> https://bugs.freedesktop.org/attachment.cgi?id=114583&action=edit debug output while crashed
debugging output attached.
https://bugs.freedesktop.org/show_bug.cgi?id=89746
--- Comment #6 from Tom Stellard tstellar@gmail.com --- (In reply to Ming-Wei Shih from comment #5)
Created attachment 114583 [details] debug output while crashed
debugging output attached.
Based on the output it looks like there may be multiple threads compiling shaders. Do you know if genymotion is multi-threaded? If it is, is there some way to force it to use only one thread?
https://bugs.freedesktop.org/show_bug.cgi?id=89746
--- Comment #7 from Michel Dänzer michel@daenzer.net --- Created attachment 114629 --> https://bugs.freedesktop.org/attachment.cgi?id=114629&action=edit radeonsi: Cache LLVMTargetMachineRef in context instead of in screen
Does this patch help?
https://bugs.freedesktop.org/show_bug.cgi?id=89746
--- Comment #8 from giuseppe spupazza@hotmail.com --- Created attachment 114641 --> https://bugs.freedesktop.org/attachment.cgi?id=114641&action=edit Radeonsi bug attachment
THis is the output when I ran:
R600_DEBUG=ps,vs,gs ./genymotion
https://bugs.freedesktop.org/show_bug.cgi?id=89746
--- Comment #9 from Michel Dänzer michel@daenzer.net --- (In reply to giuseppe from comment #8)
Radeonsi bug attachment
Is that from running with the patch applied?
https://bugs.freedesktop.org/show_bug.cgi?id=89746
--- Comment #10 from Ming-Wei Shih xmingske@gmail.com --- Created attachment 114646 --> https://bugs.freedesktop.org/attachment.cgi?id=114646&action=edit [DEBUG] successful launch
https://bugs.freedesktop.org/show_bug.cgi?id=89746
--- Comment #11 from Ming-Wei Shih xmingske@gmail.com --- It not solved with #7, but things behave differently now.
It's still hit and miss to get it running but when it fails it doesn't crash any more, just gives an error that it cannot connect to the vm.
What's strange though is that when it fails I don't get any debugging at all, so that that means there is a problem with genymotion itself? But then why this never happens with llvm 3.5?
As far as I can tell genymotion's player (the part using OpenGL) is multi-threaded and I can't find a way to disabled it.
Attached a successful run in #10, don't know if that's helpful at all.
https://bugs.freedesktop.org/show_bug.cgi?id=89746
--- Comment #12 from Ming-Wei Shih xmingske@gmail.com --- My bad, the patch in #7 fixed the regression for me.
I was having issues earlier because an other user had genymotion running and locked on the same machine, genymotion sometimes has issues to find the correct session and times out when there are multiple users (uid) using it.
https://bugs.freedesktop.org/show_bug.cgi?id=89746
--- Comment #13 from giuseppe spupazza@hotmail.com --- How do I apply the patch? Can anyone help me indicating the command pls?
https://bugs.freedesktop.org/show_bug.cgi?id=89746
--- Comment #14 from Ming-Wei Shih xmingske@gmail.com --- I don't know if here is the best place to do this, in short
- download the patch - download mesa (either git or tarball), unpack, cd into that dir - patch -p1 < /path/to/the/patch - compile & install
https://bugs.freedesktop.org/show_bug.cgi?id=89746
--- Comment #15 from giuseppe spupazza@hotmail.com --- patch at #7 seemed to have solved the issue with genymotion for me too
https://bugs.freedesktop.org/show_bug.cgi?id=89746
--- Comment #16 from Ming-Wei Shih xmingske@gmail.com --- patch applied cleanly against 10.5.2, been running this for almost 2 days.
https://bugs.freedesktop.org/show_bug.cgi?id=89746
Michel Dänzer michel@daenzer.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #17 from Michel Dänzer michel@daenzer.net --- Module: Mesa Branch: master Commit: d64adc3a79e419062432cfa8d1cbc437676a3fbd URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d64adc3a79e419062432cfa8d1c...
Author: Michel Dänzer michel.daenzer@amd.com Date: Thu Mar 26 11:32:59 2015 +0900
radeonsi: Cache LLVMTargetMachineRef in context instead of in screen
Fixes a crash in genymotion with several threads compiling shaders concurrently.
https://bugs.freedesktop.org/show_bug.cgi?id=89746
--- Comment #18 from Kevin wittyman37@yahoo.com --- I think this goes along with my issue in this bug report https://bugs.freedesktop.org/show_bug.cgi?id=89685
https://bugs.freedesktop.org/show_bug.cgi?id=89746
--- Comment #19 from Darek Deoniziak darekdeoniziak@gmail.com --- Hi, not really sure if my issue is related to this one.
The problem with genymotion occured to me while using DRI_PRIME=1 genymotion after updating drivers using oibaf ppa https://launchpad.net/~oibaf/+archive/ubuntu/graphics-drivers on Ubuntu 16.04.
I have Dell Inspirion 7548 with Radeon Opal R7 M265. Genymotion on Intel 5500 Broadwell G2 still works.
glxinfo OpenGL renderer: Gallium 0.4 on AMD OLAND (DRM 2.43.0 / 4.4.0-36-generic, LLVM 3.9.0)
I know it is newer LLVM and probably problem was fixed in the past, not sure what version of LLVM is used in stock 16.04.
While running genymotion with DRI_PRIME=1 I am getting these errors: libGL error: unable to load driver: radeonsi_dri.so libGL error: driver pointer missing libGL error: failed to load driver: radeonsi libGL error: unable to load driver: swrast_dri.so libGL error: failed to load driver: swrast
I've searched around the web and added this to my .profile: export LD_PRELOAD='/usr/$LIB/libstdc++.so.6' export DISPLAY=:0
That helped with running steam but not genymotion. But actually I am not sure if this is related to the emulator issue itself, I might have been getting these error messages too before I've updated oibaf drivers. The genymotion main menu panel to run emulators work, but emulators won't display.
The genymotion emulator log gives me: [Genymotion Player] [Warning] Unrecognized OpenGL version
https://bugs.freedesktop.org/show_bug.cgi?id=89746
--- Comment #20 from Emil Velikov emil.l.velikov@gmail.com --- Darek, please open a separate bug for your issue.
In general using "export LIBGL_DEBUG=verbose" and/or "export LD_DEBUG=libs" allows everyone to see a bit more about which libraries are picked and why things are failing. It's worth adding some of that in the report.
dri-devel@lists.freedesktop.org