libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.07k stars 1.81k forks source link

[Linux] OpenGL drivers ignore GPU Index #14945

Open Sanaki opened 1 year ago

Sanaki commented 1 year ago

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

Environment information

zoltanvb commented 1 year ago

This does not help to solve the problem, but I can say that the GPU index setting should be intentionally hidden when selecting gl or glcore driver (or anything that is not D3D10/11/12 or Vulkan), and indeed it has no effect on the RetroArch GL drivers.

LibretroAdmin commented 1 year ago

Trying to enumerate OpenGL GPU devices is a platform vendor-specific mess in a way that doing the same with Vulkan, D3D11/D3D12 or Metal isn't.

And IIRC Nvidia even locks it behind their Quadro lineup of professional graphics cards.

Sanaki commented 1 year ago

That's somehow as unsurprising as it is disappointing. Thanks for the info. Feel free to close this if it's not viable then.