azahar-emu / azahar

A new Citra fork
https://azahar-emu.org/
2.75k stars 134 forks source link

Arm64 Linux build has access to OpenGL when it is not supported #124

Closed MadameMalady closed 4 months ago

MadameMalady commented 7 months ago

Is there an existing issue for this?

Affected Build(s)

2110

Description of Issue

Lime3DS doesn't launch on any arm64 devices. (You probably still have it set to expect opengl 3.3..? on arm still? arm64 doesnt support opengl 3.3)

Expected Behavior

For it to use vucan on arm, always. opengl 3.3 doesnt exist for arm64, and probably never will.

Reproduction Steps

Install Lime from flathub on any arm device

Log File

not available.

System Configuration

Not Related, effects all arm64 devices.

OpenSauce04 commented 6 months ago

I was going to fix this using a Raspberry Pi I thought I had on hand, however I am unable to find it. Someone else will have to submit a pull request for this unless I end up finding it later on.

Ranomez commented 6 months ago

It can actually launch on certain configurations but games can't be played on devices that don't have Vulkan (some have the hardware support but no kernel support yet) since it just tells us it requires OpenGL 4.3 (self compiled, not flatpak since flatpak just runs with llvmpipe for me because support for my GPU isn't in mainline MESA). I've started lookin at a way to use OpenGL ES for Linux ARM64 as well since it's already a thing for Android but no idea if that's even possible?

OpenSauce04 commented 6 months ago

...not flatpak since flatpak just runs with llvmpipe for me because support for my GPU isn't in mainline MESA).

I thought the issue was related to the Flatpak version? It's mentioned in the original issue.

Ranomez commented 6 months ago

I wrote that in a break today so doesn't surprise me that it's written poorly but anyway: It's not exactly true that the flatpak won't work on ARM64 devices, there is no OpenGL 3.3 but there's 2 cases where it works:

  1. The driver fake reports that version, which is something you have to do yourself usually but some manufacturers chose to include that in their official images. (it's also something one can do on Raspberry Pi as well)
  2. The driver is not supported by stable Mesa (need to use a fork or a driver that's planned for mainlining with a future Linux version), which is what flatpak always uses, in which case everything will just run with llvmpipe and be completely unable to ever use the GPU.

However there's a secondary issue, even when the flatpak does work and can access the GPU... The emulator still won't work for most devices because anything OpenGL 4.x is a distant dream and the Vulkan situation on ARM Linux is pretty sad... Even where the hardware does support it the driver doesn't and usually won't for a very long time.

What I'm basically saying is that just getting the flatpak to run isn't enough, we can usually just do that ourselves by setting some environment variable but most devices still can't use the emulator after.

MadameMalady commented 6 months ago

Flatpak runs fine on arm, and so does opengl es, standard opengl, (3.3) , does not exist on arm.

(godot projects use opengl es, for example, on their android and arm64 builds.)

It's failing bc you have it requesting a driver that doesn't exist on the platform.

MadameMalady commented 6 months ago

You really really should be using Vulcan on arm though, opengl es is probably going to lag behind vulcan on implemented features for awhile

MadameMalady commented 6 months ago

I wrote that in a break today so doesn't surprise me that it's written poorly but anyway: It's not exactly true that the flatpak won't work on ARM64 devices, there is no OpenGL 3.3 but there's 2 cases where it works:

1. The driver fake reports that version, which is something you have to do yourself usually but some manufacturers chose to include that in their official images. (it's also something one can do on Raspberry Pi as well)

2. The driver is not supported by stable Mesa (need to use a fork or a driver that's planned for mainlining with a future Linux version), which is what flatpak always uses, in which case everything will just run with llvmpipe and be completely unable to ever use the GPU.

However there's a secondary issue, even when the flatpak does work and can access the GPU... The emulator still won't work for most devices because anything OpenGL 4.x is a distant dream and the Vulkan situation on ARM Linux is pretty sad... Even where the hardware does support it the driver doesn't and usually won't for a very long time.

What I'm basically saying is that just getting the flatpak to run isn't enough, we can usually just do that ourselves by setting some environment variable but most devices still can't use the emulator after.

The vulcan drivers on arm64 devices vary in their implemented protocals, but for many arm64 devices with mali gpus, the situation is actually quite good, contrary to the impression you have. Emulators like ryujinx for switch, and dolphin, run beautifully, your issues are probably more with low end devices with less than 8gb of ram. I make games and apps for arm64 linux devices (Mobile linux phones and tablets), and I can promise you these devices are more than capable of giving you a good experience with 3d rendering, today.

Ranomez commented 6 months ago

I wrote that in a break today so doesn't surprise me that it's written poorly but anyway: It's not exactly true that the flatpak won't work on ARM64 devices, there is no OpenGL 3.3 but there's 2 cases where it works:

1. The driver fake reports that version, which is something you have to do yourself usually but some manufacturers chose to include that in their official images. (it's also something one can do on Raspberry Pi as well)

2. The driver is not supported by stable Mesa (need to use a fork or a driver that's planned for mainlining with a future Linux version), which is what flatpak always uses, in which case everything will just run with llvmpipe and be completely unable to ever use the GPU.

However there's a secondary issue, even when the flatpak does work and can access the GPU... The emulator still won't work for most devices because anything OpenGL 4.x is a distant dream and the Vulkan situation on ARM Linux is pretty sad... Even where the hardware does support it the driver doesn't and usually won't for a very long time. What I'm basically saying is that just getting the flatpak to run isn't enough, we can usually just do that ourselves by setting some environment variable but most devices still can't use the emulator after.

The vulcan drivers on arm64 devices vary in their implemented protocals, but for many arm64 devices with mali gpus, the situation is actually quite good, contrary to the impression you have. Emulators like ryujinx for switch, and dolphin, run beautifully, your issues are probably more with low end devices with less than 8gb of ram. I make games and apps for arm64 linux devices (Mobile linux phones and tablets), and I can promise you these devices are more than capable of giving you a good experience with 3d rendering, today.

Yes, the Vulkan situation on Linux with Mali is decent but that's a now thing and for old ones mostly, the main test device I am using right now actually has a RK3588 and 32 GB RAM, the Mali g610 still doesn't have Vulkan working (at all) and who knows when that will be a thing. I have more devices on hand than I can count, of which only 2 with less than 8 GB RAM and only 3 with a non Mali GPU (currently usable ones), thing is even on the ones where Vulkan should work now it was always a struggle to get it working and I wasn't even always able to get it working, especially for less known devices cause it just wouldn't boot with the modified kernel. Your impression comes probably from sticking only with the most popular brands and devices but that's not what everyone has, I agree that they are more than capable to give a good enough experience but it just doesn't happen as fast as it would be normal. Don't just assume I'm taking about things I don't know anything about, I've had ARM development devices for over 10 years I can tell you the story I'm telling comes from my personal experience, Vulkan support comes very late usually and with the boards/notebooks/mini PCs being out of the support period at that time it's just a real pain to get it working and not always even possible because they sometimes use proprietary drivers to get the entire hardware working which won't work with a newer kernel. But anyway taking into account the RK3588 situation for example, even if Vulkan support will come eventually (even that seems an uncertainty at this point), wouldn't it be better to also have OpenGL ES support so people buying a new board can just use the emulator instead of having to wait for potentially years to get Vulkan? And before you ask, yes, some of the GPUs in my devices got Vulkan support on Linux after more than 2 years of waiting.

MadameMalady commented 6 months ago

I wrote that in a break today so doesn't surprise me that it's written poorly but anyway: It's not exactly true that the flatpak won't work on ARM64 devices, there is no OpenGL 3.3 but there's 2 cases where it works:

1. The driver fake reports that version, which is something you have to do yourself usually but some manufacturers chose to include that in their official images. (it's also something one can do on Raspberry Pi as well)

2. The driver is not supported by stable Mesa (need to use a fork or a driver that's planned for mainlining with a future Linux version), which is what flatpak always uses, in which case everything will just run with llvmpipe and be completely unable to ever use the GPU.

However there's a secondary issue, even when the flatpak does work and can access the GPU... The emulator still won't work for most devices because anything OpenGL 4.x is a distant dream and the Vulkan situation on ARM Linux is pretty sad... Even where the hardware does support it the driver doesn't and usually won't for a very long time. What I'm basically saying is that just getting the flatpak to run isn't enough, we can usually just do that ourselves by setting some environment variable but most devices still can't use the emulator after.

The vulcan drivers on arm64 devices vary in their implemented protocals, but for many arm64 devices with mali gpus, the situation is actually quite good, contrary to the impression you have. Emulators like ryujinx for switch, and dolphin, run beautifully, your issues are probably more with low end devices with less than 8gb of ram. I make games and apps for arm64 linux devices (Mobile linux phones and tablets), and I can promise you these devices are more than capable of giving you a good experience with 3d rendering, today.

Yes, the Vulkan situation on Linux with Mali is decent but that's a now thing and for old ones mostly, the main test device I am using right now actually has a RK3588 and 32 GB RAM, the Mali g610 still doesn't have Vulkan working (at all) and who knows when that will be a thing. I have more devices on hand than I can count, of which only 2 with less than 8 GB RAM and only 3 with a non Mali GPU (currently usable ones), thing is even on the ones where Vulkan should work now it was always a struggle to get it working and I wasn't even always able to get it working, especially for less known devices cause it just wouldn't boot with the modified kernel. Your impression comes probably from sticking only with the most popular brands and devices but that's not what everyone has, I agree that they are more than capable to give a good enough experience but it just doesn't happen as fast as it would be normal. Don't just assume I'm taking about things I don't know anything about, I've had ARM development devices for over 10 years I can tell you the story I'm telling comes from my personal experience, Vulkan support comes very late usually and with the boards/notebooks/mini PCs being out of the support period at that time it's just a real pain to get it working and not always even possible because they sometimes use proprietary drivers to get the entire hardware working which won't work with a newer kernel. But anyway taking into account the RK3588 situation for example, even if Vulkan support will come eventually (even that seems an uncertainty at this point), wouldn't it be better to also have OpenGL ES support so people buying a new board can just use the emulator instead of having to wait for potentially years to get Vulkan? And before you ask, yes, some of the GPUs in my devices got Vulkan support on Linux after more than 2 years of waiting.

I have no idea why you got so defensive there, but open gl es support is fine to include, I still think the driver selection should default to vulcan, but regardless of opinions, you could simply run some commands on linux builds to get gpu support information and default to the best option for each device that way, regardless of your favorite driver.

You also shouldn't hold out for too old of arm64 chipsets to get vulcan support (or any kind of gpu driver support, really), unless they're well maintained by projects like, postmarketOS.

Support targets should be devices like the Pi's, rk3588(s)-based chipsets.

I get the feeling two people being aggressively nerdy to one another on github isn't going to exactly help get this issue sorted though.

If you have a good suggestion to get this issue sorted, i'm all ears; I think checking the gpu information by default is probably the way to ensure the highest compatibility.

MadameMalady commented 6 months ago

You may wish to just remove your arm64 build till such a time where you or someone familiar with arm64 and proper screen-factoring can help you fix somethings.

As it stands, they don't work on any of the arm devices i've tested on and probably will confuse users as to why it has an arm build that's unfunctional and unsupported.

Appologies for being unable to offer more assistance.

OpenSauce04 commented 6 months ago

I agree. The ARM Flatpak will be temporarily disabled in 2115

mrcmunir commented 6 months ago

[Quote removed]

This not true arm64 working fine

[Quote removed]

This doesn't true Opengl core can running fine under GPU Adreno 600 and Tegra TX1 .

OpenSauce04 commented 6 months ago

This doesn't true Opengl core can running fine under GPU Adreno 600 and Tegra TX1 .

@mrcmunir Are you using an Android device? This discussion is exclusively referring to the ARM Linux Flatpak

mrcmunir commented 6 months ago

@mrcmunir Are you using an Android device? This discussion is exclusively referring to the ARM Linux Flatpak

I'm always talked about linux aarch64/arm64 I mean that Citra or any fork working running fine if the graphics driver supports the graphics API requested. The reason why it did not work on some arm64 devices under Opengl because it does not supported API required Opengl es 3.2/Opengl Desktop minimal required in the driver. Screenshot from 2024-06-01 17-37-52

Screenshot from 2024-06-01 17-37-16

masies-hack commented 5 months ago

Lima3DS works well for me. I have a tegrax1 v1 switch with Linux, both Ubuntu 22.04 and 24.04 and it works fine. if an arm device that is not compatible with OpenGL or vulkan is used. It is normal that it does not turn on. Tegrax1 and jetson you should have no problems. With other devices it may be, especially if the drivers are not installed or optimized. The version shown, I compiled it today July-04-2024

https://github.com/Lime3DS/Lime3DS/assets/56441695/840e081e-97d1-4ca2-a25d-db1c9b663879

image

mrcmunir commented 5 months ago

That's what I said in the previous message. The Mali drivers are disastrous with very poor R&D and support for many graphics techniques of the modern era in both OpenGL and Vulkan. In comparison to other vendors i.e. Nvidia Tegra, the Adreno 600 or Apple m1 GPUs can run more things by offering drivers that are up to par.

Anonymous941 commented 5 months ago

I've got an RPi 4 lying around, is there anything I can do to help?

OpenSauce04 commented 4 months ago

Fixed by b240dac, thanks for the report!

mrcmunir commented 4 months ago

Fixed by b240dac, thanks for the report!

That broken Option OpenGL under aarch64 devices can OpenGL run (i.e Tegra devices , Apple m1+ device asahi , Adreno 600 gpus , any other Pci express board ) . You only needed disable OpenGL under device can't OpenGL run not check by platform .