nokyan / resources

Keep an eye on system resources
GNU General Public License v3.0
708 stars 56 forks source link

AMD video encoder usage is actually decoder usage and vice versa #212

Open freaktechnik opened 5 months ago

freaktechnik commented 5 months ago

Is there an existing issue for this?

Current Behavior

The "Video Encoder Usage" tracks the usage of hardware decoding, the "Video Decoder Usage" presumably tracks the usage of hardware encoding.

Expected Behavior

The "Video Encoder Usage" tracks the usage of hardware encoding, "Video Decoder Usage" tracks the usage of hardware decoding.

Steps To Reproduce

  1. Have an AMD GPU where this reproduces (in my case an 7900 XTX)
  2. Select the GPU
  3. Use hardware decoding to play a video
  4. Video Decoder Usage stays at 0%, while Video Encoder Usage shows activity

Environment

Program Version: 1.4.0
Package Type: Flatpak
System: Fedora 39 (Linux 6.8.4-200.fc39.x86_64, Gnome 45.5)
Graphics (shown as GPU 2 in Resources): AMD Radeon™ RX 7900 XTX

Anything else?

No response

nokyan commented 5 months ago

Hi, this is known and an unfortunate side effect of AMD merging the decoder and encoder parts of their media engine since RX 7xxx. I haven't yet found a way to properly find out whether a GPU has this new merged engine or the old seperated engine, and I'd really like to avoid using regex on the GPU name or hardcoding a list of PCI IDs. :/

Umio-Yasuno commented 1 month ago

I think the VCN HW IP version we can get from ip_discovery sysfs (ip_discovery/die/0/UVD/0/major) will be helpful.
Currently, VCN v4.x (major version: 4) or higher have unified decoding and encoding queues.

patrulhasirius commented 2 days ago

I think I'm having the same issue in an intel iGPU, is it the same reason or should I report it?

Firefox is showing encoder usage and no decoder usage while playing a youtube video.

nokyan commented 2 days ago

I think I'm having the same issue in an intel iGPU, is it the same reason or should I report it?

Firefox is showing encoder usage and no decoder usage while playing a youtube video.

Hi, the reason for that is the same as for newer AMD GPUs, Intel GPUs unfortunately do not differentiate between encode and decode and I haven't yet found a way to make this work in the Apps and Processes pages.