libretro / libretro/RetroArch

[Linux] OpenGL drivers ignore GPU Index

Open
#14,945 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature request gpu api: opengl
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
  1. Obtain a hybrid graphics device
  2. Change GPU Index to the second GPU, change video driver to glcore
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.