[Linux] OpenGL drivers ignore GPU Index
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 14.1k
- Forks
- 2.2k
- Avg merge
- 7h 35m
- Merged PRs (30d)
- 51
Description
Description
On Linux (cannot confirm either way for Windows), OpenGL drivers ignore the selected GPU Index, instead utilizing whichever GPU comes first in the list. Vulkan (at least as of #14889) handles the GPU Index correctly. This can easily be verified on an nvidia hybrid graphics device using nvtop, as well as via the raw performance drop from using the wrong card. Starting retroarch with prime-run will reorder the GPU indices, allowing the correct card to be used, but this isn't a "good" solution.
Expected behavior
Whichever GPU Index is selected in settings will be used.
Actual behavior
GPU 0 is used for OpenGL contexts.
Steps to reproduce the bug
- Obtain a hybrid graphics device
- Change GPU Index to the second GPU, change video driver to glcore
- Start any game that utilizes OpenGL and observe GPU performance
Bisect Results
Seemingly not applicable
Version/Commit
- RetroArch: v1.14.0 -- 78326188c4 --
Environment information
- OS: Garuda KDE Dr460nized (Arch-based), current
- Compiler: GCC (12.2.1) 64-bit
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce on a Linux hybrid-GPU system using the listed steps: select the second GPU, choose the glcore video driver, and observe usage with nvtop. Start by tracing the OpenGL context and GPU Index handling for the glcore path, then compare it with Vulkan's behavior described in #14889. Done means the selected GPU is used instead of always GPU 0.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- computer-graphics, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100