mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.34k stars 2.91k forks source link

What Do These MVK Errors Mean? #13556

Closed FriedTofu527 closed 8 months ago

FriedTofu527 commented 8 months ago

I recently started using shaders and my terminal is filled with MVK errors. Does this mean I set something up incorrectly or that there are issues with playback? I don't notice any visible errors during playback and no frames are being dropped either. Doing Shift + I then 2 shows the filters seemingly working fine. I also have another question about the shaders. Does setting the --scale and --cscale options do anything when I have shaders active? My understanding is that the shaders should handle all of the scaling by themselves and I won't have to manually configure anything.

The errors I'm getting all look like this:

[mvk-error] VK_ERROR_OUT_OF_DEVICE_MEMORY: Could not create MTLCounterSampleBuffer of size 128, for 16 queries, in query pool of type VK_QUERY_TYPE_TIMESTAMP. Reverting to emulated behavior. (Error code 0): Cannot allocate sample buffer

Shift + I shows me this:

Screenshot 2024-02-25 at 4 13 45 AM Screenshot 2024-02-25 at 4 14 06 AM

Mpv Version: v0.37.0-364-g2cc3bc12db Libplacebo Version: v7.346.0 (v6.338.0-85-ge987124b) Device: 2021 14" MacBook Pro OS Version: Sonoma 14.2 Config File:

vo=gpu-next
gpu-api=vulkan
gpu-context=macvk
hwdec=videotoolbox

macos-force-dedicated-gpu=yes
no-hidpi-window-scale
fullscreen=yes
target-colorspace-hint

glsl-shader="/Users/geoffreyhuang/Downloads/shaders/ArtCNN_C4F16_LL.glsl"
glsl-shader="/Users/geoffreyhuang/Downloads/shaders/CfL_Prediction.glsl"

icc-profile="/Library/ColorSync/Profiles/Displays/Color LCD-37D8832A-2D66-02CA-B9F7-8F30A301B230.icc"
icc-intent=0
icc-use-luma

scale-antiring=0.6
#scale=ewa_lanczos
#cscale=ewa_lanczos
dscale=catmull_rom

deband=yes
deband-iterations=4
deband-threshold=48
deband-range=24
deband-grain=4

dither-depth=no

log file: output.txt

Akemi commented 8 months ago

I recently started using shaders and my terminal is filled with MVK errors. Does this mean I set something up incorrectly or that there are issues with playback? I don't notice any visible errors during playback and no frames are being dropped either. Doing Shift + I then 2 shows the filters seemingly working fine. I also have another question about the shaders. Does setting the --scale and --cscale options do anything when I have shaders active? My understanding is that the shaders should handle all of the scaling by themselves and I won't have to manually configure anything.

those shaders don't do fractional/arbitrary scaling so setting any scale option can be useful, especially on scale factors below 2. though just read up on those specific shaders, their readmes explain a few things.

The errors I'm getting all look like this:

[mvk-error] VK_ERROR_OUT_OF_DEVICE_MEMORY: Could not create MTLCounterSampleBuffer of size 128, for 16 queries, in query pool of type VK_QUERY_TYPE_TIMESTAMP. Reverting to emulated behavior. (Error code 0): Cannot allocate sample buffer

from the moltenvk docs https://github.com/KhronosGroup/MoltenVK/blob/37361ccd5595ff08c050981856903713f96221d2/Docs/Whats_New.md?plain=1#L189-L190

- Report error, but do not fail on request for timestamp query pool that is too 
  large for `MTLCounterSampleBuffer`, and fall back to emulation via CPU timestamps.

from the corresponding metal docs https://developer.apple.com/documentation/metal/mtldevice/3081741-newcountersamplebufferwithdescri

The method may produce an error if the GPU driver has exhausted its underlying resources for counter sample buffers.

you are just reaching the limits of your hardware/graphics stack with your setup. if anything is wrong, that's something you have to see for yourself.