A Complement story in the Fosdem 2022 Talk

|

At 6th February, fortunately I had a chance to have a lightening talk at the graphics devroom of fosdem 2022. At the time I presented a summary of the status of turnip driver development in mesa and I’d like to write some more things that I couldn’t say at the talk as a complement to the talk.

History of the development.

I write here again, Turnip is the code name of Qualcomm Adreno GPU’s open-source vulkan driver. I dived into this GPU at 2018 and participated in developing the Freedreno OpenGL driver, that is founded and leaded by Rob Clark. It was new for me to develop a user-space graphics driver at that time and it was a good chance to learn and experience of how GPUs work, how to develop a graphics driver and how to communicate with Mesa community. Due to the contributions to the freedreno driver at that time, I could be a committer at the Mesa community. And at the beginning of 2020, Igalia including me started working on the opensource vulkan driver, that is “Turnip” driver. Actually the turnip development started already at 2018 by Google people and it’s definately lucky for us to get a chance to participate in the turnip development.

As I said in the talk it was immature though it works fine at the beginning thus lots of extensions and features are implemented since 2020. Joanathan Marek and Connor Abbott played an important role at this time(and still) and they implemented very basic and essential features from the scratch (and copied from freedreno if necessary). So Igalia could get involved in the progress of the implementation of extensions and features on top of what they have done. At 2021, we could speed-up the progress based on accumulated experiences and knowledges, especially Danylo’s join was a great addition to the project and he’s been always doing a great job since then. I won’t write details about this in this post but you can refer to Samuel and Danylo’s blog, who are my great colleagues at Igalia. It’s a pity that there’s no posts about my works though. Hopefully I could write some more posts about it in the near future. (I got a list to write already! XD)

One of main goals: Playing games!

Especially I’d like to highlight this in this post, probably this is why I write this post.

I presented things like below at the “What happend at 2021”

  • Make it run for windows games with dxvk/vkd3d on linux/arm
    • with x86 emulators (Fex, Box86)
    • Some window games started running!

And what about this at the “What’ll happen in 2022”?

  • Focusing on real world use cases.
    • Still not enough games running on arm.
    • Trying to run more window games via wine(proton)

Cool! Isn’t it?

Actually I realized many people out there are very interested in this, that is to “make games run on linux/arm”, of course, including windows/x86 games. And I know people want to test by themselves with their devices if possible but there are some issues to do it.

  • First, qualcomm devices are very expensive comparing to RasberryPi or other arm devices.
  • Second, the setup is so tricky to make and there’s no good document for the setup.
  • Third, the setup is unstable to run every game so far even if you’ve completed the setup.

Honestly I’m not going to write details like how to do in this post. Instead, I’d like to show some efforts to do it as an example of what we’ve tried. I said in the talk that we’ve been trying this complicated setup because we want to test turnip with real cases but there are not enough native games running on linux/arm yet. Here are cases that we’ve been trying.

The first case is here : https://gitlab.freedesktop.org/mesa/mesa/-/issues/4738.

One day at 2021, one issue has been raised in the community. As you see at the system information, someone was trying to run window games with turnip on a qualcomm device.

There were 2 kind of setups on Android: One, most complicated setup, is using virgl-vtest to get OpenGL calls from windows games as you see below. It seems, at that time, the ExaGear couldn’t access to GPU directly then they used virgl-vtest-server to access to GPU with turnip, which causes performance degradation.

-------------------------------------------------------
Window Games
-------------------------------------------------------
ExaGear:    (virgl) | <----> |  virgl-vtest
                    |        | ------------------------
 Wine on            |        |  turnip/zink
  x86 Ubuntu 18.04  |        | ------------------------
                    |        |  Ubuntu 20.04 on chroot
-------------------------------------------------------
                  Android 10
-------------------------------------------------------

So there was another try to not use virgl-vtest-server and seems it was successful for a few games with another setup like this:

---------------------------------
Window Games
---------------------------------
WINE(proton using dxvk)
---------------------------------
X86 emulator(Box86)
---------------------------------
turnip/zink
---------------------------------
Ubuntu 20.04 on Termux proot
---------------------------------
Android 10
---------------------------------

Which looks simpler but still complicated. As you can see in the issue, Danylo managed to set up the system and found root causes and fixed all of it.

Now it looks someone has succeeded in accessing to GPU directly in this emulaotr so we wouldn’t need to use virgl-vtest any more since we got new issue for the setup including ExaGear. :) See https://gitlab.freedesktop.org/mesa/mesa/-/issues/6024 in detail.

The second case is here: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5723

That is similar to the second setup of the first case, which is like

---------------------------------
Window Games
---------------------------------
WINE
---------------------------------
X86 emulator(Box86)
---------------------------------
turnip/zink
---------------------------------
Linux
---------------------------------

Yeah, starts using linux directly instead of Termux for android, thus it got simple a bit more. You can see the instructions and some trouble shootings here for this setup: https://github.com/Heasterian/Box86-64-on-SD845-mobian

The third case is to run android games with just replacing the proprietary driver with turnip

Which is most simple. You can see instructions how to build the turnip driver for Android here But note that there seems to be not enough vulkan games on Android yet, which means that we need to try with x86 emulators to test real games. Also You can see some efforts on this setup at Danylo’s blog as the following:

https://blogs.igalia.com/dpiliaiev/turnips-in-the-wild-part-1/ https://blogs.igalia.com/dpiliaiev/turnips-in-the-wild-part-2 https://blogs.igalia.com/dpiliaiev/gfxreconstruct-test-mobile-gpus/

Additionally there was also a talk about emulation on arm for playing games: FEX-Emu: Fast(-er) x86 emulation for AArch64 I think you can get more informations to run x86 games on arm/linux and I believe you can have fun too with this talk.

Ok, until here, I did tell a bit more that I missed at the talk. Hopefully it could be useful to someone interested. Also I’ll give it a try to write far more details, how to setup and run games step by step for example, in the near future.

Thanks for reading!

Comments