mpv triggers massive kernel memory leak with RADV, also error-diffusion dithering shader is slow
Check out mpv
with gpu-api=vulkan
and this in mpv.conf:
profile=gpu-hq
vo=gpu,vaapi,xv,x11,drm,tct,caca,null,
opengl-pbo=yes
gpu-api=vulkan
swapchain-depth=4
vulkan-queue-count=4
vulkan-swap-mode=fifo
vulkan-async-transfer=yes
vulkan-async-compute=yes
dither-depth=auto
dither=error-diffusion
zimg-dither=error-diffusion
# sierra-lite is default, sierra-2 is heavy and sierra-3 may fail due to maxComputeSharedMemorySize
error-diffusion=sierra-2
temporal-dither=no
deband=yes
deband-iterations=1
deband-threshold=160
deband-grain=16
deband-range=64
scaler-lut-size=10
scale-antiring=0
scale=ewa_lanczossharp
cscale=ewa_lanczossharp
dscale=mitchell
scaler-resizes-only=yes
correct-downscaling=yes
linear-downscaling=yes
linear-upscaling=no
sigmoid-upscaling=yes
gpu-sw=yes
alpha=blend
blend-subtitles=no
interpolation=yes
interpolation-threshold=0.01
video-sync=display-resample-vdrop
video-sync-max-video-change=3
video-sync-max-audio-change=0.080
hr-seek-framedrop=no
framedrop=vo
initial-audio-sync=yes
autosync=100
mc=0.25
tscale=box
tscale-window=quadric
tscale-radius=0.96
tscale-clamp=0.0
sws-allow-zimg=yes
sws-scaler=lanczos
zimg-scaler=lanczos
zimg-fast=no
hwdec=vaapi-copy
hwdec-extra-frames=16
hwdec-codecs=hevc,av1
# just to really stress out CPU and GPU
# https://gist.github.com/v-fox/43c287426c366679afc4c65eece60cbc
#vf-add=vapoursynth=~/.config/mpv/vapoursynth/motioninterpolation.vpy:2:16
# https://github.com/igv/FSRCNN-TensorFlow/releases
#glsl-shader="~/.config/mpv/shaders/opengl/FSRCNNX_x2_8-0-4-1.glsl
# https://github.com/bjin/mpv-prescalers
#glsl-shader="~/.config/mpv/shaders/compute-opengl/ravu-zoom-r3-yuv.hook"
icc-profile-auto=yes
icc-3dlut-size=256x256x256
hdr-compute-peak=yes
tone-mapping=hable
vd-lavc-dr=yes
vd-lavc-threads=6
ad-lavc-threads=2
zimg-threads=8
On my systems with RX580, kernel 5.10.4 and Mesa master using vulkan at all makes RAM unavailable until only swap is used by slowly "draining" it while mpv is running, 2-3 hours takes 10-16 GB. Killing mpv does not return RAM and what took it is not visible in top
/atop
.
Also, reported screen fps in mpv would dip when ACO is used with dither=error-diffusion
& error-diffusion=sierra-2
but about the time it became default, even RADV_DEBUG="llvm" doesn't help to be able to use anything but sierra-lite
.
Have no idea if any of that caused my Mesa, mpv or kernel.