Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wayland: DRI_PRIME warnings raised by DetectPrimeEGL #88364

Open
Tracked by #88346
akien-mga opened this issue Feb 15, 2024 · 1 comment · May be fixed by #88516
Open
Tracked by #88346

Wayland: DRI_PRIME warnings raised by DetectPrimeEGL #88364

akien-mga opened this issue Feb 15, 2024 · 1 comment · May be fixed by #88516

Comments

@akien-mga
Copy link
Member

Tested versions

  • Reproducible in 4.3.dev (907db8e), only after the merge of the Wayland backend adding DetectPrimeEGL

System information

Fedora Linux 39 (KDE Plasma) - Wayland - Vulkan (Forward+) - dedicated AMD Radeon RX 7600M XT (RADV NAVI33) () - AMD Ryzen 7 7840HS w/ Radeon 780M Graphics (16 Threads)

Issue description

When running the Godot project manager with the Wayland driver and the GL compatibility backend, the following warnings are printed:

Invalid value (0) for DRI_PRIME. Should be > 0
Inconsistent value (2) for DRI_PRIME. Should be < 2 (GPU devices count). Using: 1
Inconsistent value (3) for DRI_PRIME. Should be < 2 (GPU devices count). Using: 1

See #86180 (comment) and following comments for context.

The current DetectPrimeEGL logic tries all integer values from DRI_PRIME=0 to DRI_PRIME=3 to see whether more than 2 GPUs may be available, and attempt to pick the best one.

Mesa doesn't seem to like running DRI_PRIME=2 or DRI_PRIME=3 when the GPU devices count is only 2. Maybe it provides a way to query what that GPU devices count is so we don't attempt the ids that aren't supported? It's pretty much Mesa's own ERR_FAIL_INDEX we need to work around on the calling side ;)

Likewise, it seems to complain about DRI_PRIME=0. It's a bit weird as we even have a message recommending using it to force using the default device, but apparently that's not correct usage? So with 2 GPUs it's only DRI_PRIME=1 to pick the second one, and no env variable to pick the first? Seems pretty weird.

All in all a pretty low priority issue, but silencing those warnings would be nice.

@hpvb has done some work on a better GPU detection for EGL which may solve this issue.

The GLX detect_prime doesn't raise warnings as currently it only tests no env var and DRI_PRIME=1. But if we decide to sync it with the current EGL one to support more than 2 GPUs, we'd have a similar issue.

Steps to reproduce

godot --display-driver wayland --rendering-driver opengl3

Minimal reproduction project (MRP)

n/a

@akien-mga akien-mga added this to the 4.x milestone Feb 15, 2024
@akien-mga akien-mga changed the title DRI_PRIME warnings raised by DetectPrimeEGL Wayland: DRI_PRIME warnings raised by DetectPrimeEGL Feb 15, 2024
@Riteo
Copy link
Contributor

Riteo commented Feb 15, 2024

FTR, I have a WIP branch which aims to use the proper EGL extension for device enumeration (thanks to the work of @hpvb). It's potentially riskier as we can't fork like we used to with the DRI_PRIME stuff, but a mesa folk guaranteed us that it shouldn't be an issue.

Edit: For some mystical reason I completely missed that you already reported hpvb's work in the OP, I'm really sorry for repeating what you said 😅. That said, I'm carrying the rest of the work by integrating it in the engine based on the probing code built by them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants