summaryrefslogtreecommitdiffstats
path: root/sub/av_sub.h
diff options
context:
space:
mode:
authorJrelvas <55360900+jrelvas-ipc@users.noreply.github.com>2024-04-30 21:17:52 +0100
committerKacper Michajłow <kasper93@gmail.com>2024-05-07 00:34:46 +0200
commit58f50c8e491f3c95ccc2f83120a0428641ff3661 (patch)
tree245f06bb3ad0b0084eee81f5ffe50cd5351a6a26 /sub/av_sub.h
parentf18ce7eca00a2ea384a5244c6b01e82e5ede0630 (diff)
downloadmpv-58f50c8e491f3c95ccc2f83120a0428641ff3661.tar.bz2
mpv-58f50c8e491f3c95ccc2f83120a0428641ff3661.tar.xz
hwdec_cuda: avoid gpu wakeup by deferring cuInit
`cuInit` wakes up the nvidia dgpu on nvidia laptops. This is bad news because the wake up process is blocking and takes a few seconds. It also needlessly increases power consumption. Sometimes, a VO loads several hwdecs (like `dmabuf_wayland`). When `cuda` is loaded, it calls `cuInit` before running all interop inits. However, the first checks in the interops do not require cuda initialization, so we only need to call `cuInit` after those checks. This commit splits the interop `init` function into `check` and `init`. `check` can be called without initializing the Cuda backend, so cuInit is only called *after* the first interop check. With these changes, there's no cuda initialization if no OpenGL/Vulkan backend is available. This prevents `dmabuf_wayland` and other VOs which automatically load cuda from waking up the nvidia dgpu unnecessarily, making them start faster and decreasing power consumption on laptops. Fixes: https://github.com/mpv-player/mpv/issues/13668
Diffstat (limited to 'sub/av_sub.h')
0 files changed, 0 insertions, 0 deletions