MangoHud icon indicating copy to clipboard operation
MangoHud copied to clipboard

Wrong GPU device usage

Open ngraham20 opened this issue 1 year ago • 5 comments

Describe the bug A clear and concise description of what the bug is.

The GPU usage % that is displayed is of the wrong device. I have a dGPU and an iGPU, and while the gpu_name shows the dedicated GPU, the percentage is of the iGPU.

List relevant hardware/software information

  • Linux Distribution: Nobara 39
  • MangoHud version: v0.7.1
  • GPU: AMD Radeon 7700S

To Reproduce Steps to reproduce the behavior: Run Mangohud

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem. The percentage MangoHUD shows against AMDGPU top. The Graphics card shown is labeled next to Info image image

ngraham20 avatar Apr 12 '24 21:04 ngraham20

Have you already tried using pci_dev config option?

Lassebq avatar Jun 09 '24 07:06 Lassebq

Also experiencing this on a RX 7600 (CPU+iGPU) + RX 580 (GPU) combo. Weirdly enough it only seems to trigger in one game of mine: Need for Speed Most Wanted 2012, where as in GTA 5 it picks up the RX 580 fine.

All Lutris settings across both games matched, no PRIME enabled.

I think it has to with the way the latest GNOME version uses the iGPU to render by default for all applications, and MangoHud incorrectly assuming that this then also applies to DXVK.

--

Update: Ensured GNOME runs on the primary GPU (RX 580) with a udev rule. More info here:

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1562

/etc/udev/rules.d/61-mutter-primary-gpu.rules

ENV{DEVNAME}=="/dev/dri/card0", TAG+="mutter-device-preferred-primary"

Could use some better matching logic, e.g. vendor and device ID.

GNOME Settings now correctly informs me it's running on the RX 580. However, MangoHud still favors the Radeon Integrated Graphics for some reason, while it's not being rendered there.

emansom avatar Jun 10 '24 04:06 emansom

nvtop has some sort mechanism to determine which application belongs to which GPU, could this be leveraged in MangoHud to identify which GPU is rendering the game?

emansom avatar Jun 10 '24 05:06 emansom

Yes it is possible to figure out which GPU is being used using said method. I'm leaning towards implementing that or just going ahead and support multiple GPUs

flightlessmango avatar Jun 10 '24 13:06 flightlessmango

Have you already tried using pci_dev config option?

It does appear that using the pci_dev config option has the desired result. Goverlay made that change for me, so I hadn't realized I was utilizing that feature

ngraham20 avatar Jun 11 '24 17:06 ngraham20