Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vo=gpu keeps dGPU awake while using the iGPU for hw decoding #15981

Open
6 tasks done
ralmachado opened this issue Mar 1, 2025 · 4 comments
Open
6 tasks done

vo=gpu keeps dGPU awake while using the iGPU for hw decoding #15981

ralmachado opened this issue Mar 1, 2025 · 4 comments
Labels

Comments

@ralmachado
Copy link

mpv Information

mpv 0.39.0 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
libplacebo version: v7.349.0
FFmpeg version: 7.1
FFmpeg library versions:
   libavcodec      61.3.100 (runtime 61.19.100)
   libavdevice     61.1.100 (runtime 61.3.100)
   libavfilter     10.1.100 (runtime 10.4.100)
   libavformat     61.1.100 (runtime 61.7.100)
   libavutil       59.8.100 (runtime 59.39.100)
   libswresample   5.1.100 (runtime 5.3.100)
   libswscale      8.1.100 (runtime 8.3.100)

Other Information

- Linux version:
NAME="Fedora Linux"
VERSION_CODENAME=""
PRETTY_NAME="Fedora Linux 41 (Workstation Edition)"
CPE_NAME="cpe:/o:fedoraproject:fedora:41"
DEFAULT_HOSTNAME="fedora"

- Kernel Version:
Linux sieger 6.13.5-200.fc41.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Feb 27 15:07:31 UTC 2025 x86_64 GNU/Linux

- GPU Model:
06:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Cezanne [Radeon Vega Series / Radeon Vega Mobile Series] [1002:1638] (rev c6)
01:00.0 3D controller [0302]: NVIDIA Corporation GA107M [GeForce RTX 3050 Mobile] [10de:25a2] (rev a1)

- Mesa/GPU Driver Version:
GPU0 (radv): Mesa 25.0.0
GPU1 (NVIDIA): 570.86.16

- Window Manager and Version:
KDE Plasma Version: 6.3.1

- Source of mpv:
fedora repository

Reproduction Steps

On a laptop with an AMD iGPU + NVIDIA dGPU, play either a H.264 or HEVC file with mpv --no-config $file --hwdec=yes --log-file=log.txt.

Expected Behavior

Output of watch cat /sys/class/drm/card0/device/power_state should be D3cold while mpv is open.

Actual Behavior

Output of watch cat /sys/class/drm/card0/device/power_state is D0 while mpv is open.
Output of sudo lsof /dev/nvidia0 shows mpv opening 5 file descriptors.

Image

Log File

log.txt

Sample Files

Big Buck Bunny

I carefully read all instruction and confirm that I did the following:

  • I tested with the latest mpv version to validate that the issue is not already fixed.
  • I provided all required information including system and mpv version.
  • I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of --log-file=output.txt.
  • I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • I attached the full, untruncated log file.
  • I attached the backtrace in the case of a crash.
@llyyr
Copy link
Contributor

llyyr commented Mar 1, 2025

Specify hwdec=vaapi instead of yes, does it still do that?

@ralmachado
Copy link
Author

Using hwdec=vaapi does not wake the dGPU, but I have some file with AV1 which can't use it, so I'd rather not hardcode vaapi into my mpv.conf.

Either way, it's odd behaviour when OpenGL is actively choosing to use an AMD gpu, no?

@llyyr
Copy link
Contributor

llyyr commented Mar 1, 2025

hwdec=auto (or yes) works by probing various hwdec APIs in a set order. nvdec just happens to be higher than vaapi so it gets probed first. As for why those FDs aren't closed after the probing is done (and failed), it's probably a bug somewhere.

You can set hwdec=vaapi,nvdec so that nvdec gets used for AV1.

@kasper93
Copy link
Contributor

kasper93 commented Mar 1, 2025

mpv during probing initializes everything and keep hardware contexts. Avoid nvdec if you can, because it is responsible for keeping dGPU alive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants