styler00dollar / VapourSynth-RIFE-ncnn-Vulkan

RIFE filter for VapourSynth
MIT License
97 stars 22 forks source link

librife.dylib is broken #12

Closed hooke007 closed 10 months ago

hooke007 commented 10 months ago

Its size is too small and looks like a shortcut. I think only original builder can load it on his own machine.

mafiosnik777 commented 10 months ago

Its size is too small and looks like a shortcut.

No one can figure anything out from that statement alone. Vapoursynth will exactly tell you what it is looking for when it's failing to load a plugin. Provide that first please.

I'd guess it's looking for ncnn & moltenvk and can't find that.

brew install molten-vk vulkan-headers ncnn

hooke007 commented 10 months ago

librife.dylib is broken

As the title said, the info is output by macos itself.

Here are the vs's log

[vapoursynth] Traceback (most recent call last):
[vapoursynth]   File "src/cython/vapoursynth.pyx", line 3121, in vapoursynth._vpy_evaluate
[vapoursynth]   File "src/cython/vapoursynth.pyx", line 3122, in vapoursynth._vpy_evaluate
[vapoursynth]   File "/Users/hooke007/.config/mpv/test2.vpy", line 4, in <module>
[vapoursynth]     core.std.LoadPlugin(path="/opt/homebrew/lib/librife.dylib")
[vapoursynth]   File "src/cython/vapoursynth.pyx", line 2857, in vapoursynth.Function.__call__
[vapoursynth] vapoursynth.Error: Failed to load /opt/homebrew/lib/librife.dylib. Error given: dlopen(/opt/homebrew/lib/librife.dylib, 0x0001): tried: '/opt/homebrew/lib/librife.dylib' (code signature in <87687D6B-C8B7-31FE-A91D-73A873867943> '/opt/homebrew/lib/librife.dylib' not valid for use in process: library load disallowed by system policy), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/librife.dylib' (no such file), '/opt/homebrew/lib/librife.dylib' (code signature in <87687D6B-C8B7-31FE-A91D-73A873867943> '/opt/homebrew/lib/librife.dylib' not valid for use in process: library load disallowed by system policy)
hooke007 commented 10 months ago

Its size is too small and looks like a shortcut.

截屏2023-10-24 18 28 32 截屏2023-10-24 18 29 09

And what magic made it so small...

mafiosnik777 commented 10 months ago

I'll try to recompile later. I don't know what changed but it wouldn't let me compile the same way as before and I had to do some workarounds with the Vulkan SDK, which probably lead to this.

mafiosnik777 commented 10 months ago

I figured it out. The brew bottle for Sonoma doesn't bundle the static library for ncnn. Last time I did it on Ventura, and that ncnn bottle has static libraries. Had to compile ncnn myself with -DNCNN_SHARED_LIB=OFF.

https://transfer.sh/RozBy5ovtH/librife.dylib (6.7 MB).

In case it still fails to load with library load disallowed by system policy, because macOS Gatekeeper acts up use xattr -c librife.dylib. Because the other one should have still worked regardless, as long as you have the dependencies installed via brew.

@hooke007

hooke007 commented 10 months ago

I have no idea.

[vapoursynth]     cut2 = core.rife.RIFE(clip=cut1, model=9, factor_num=2, factor_den=1, gpu_id=0, gpu_thread=2, sc=True, skip=True, skip_threshold=60.0)
[vapoursynth]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[vapoursynth]   File "src/cython/vapoursynth.pyx", line 2857, in vapoursynth.Function.__call__
[vapoursynth] UnicodeDecodeError: 'utf-8' codec can't decode byte 0x90 in position 6: invalid start byte
mafiosnik777 commented 10 months ago

I have no idea.

[vapoursynth]     cut2 = core.rife.RIFE(clip=cut1, model=9, factor_num=2, factor_den=1, gpu_id=0, gpu_thread=2, sc=True, skip=True, skip_threshold=60.0)
[vapoursynth]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[vapoursynth]   File "src/cython/vapoursynth.pyx", line 2857, in vapoursynth.Function.__call__
[vapoursynth] UnicodeDecodeError: 'utf-8' codec can't decode byte 0x90 in position 6: invalid start byte

It's working now, I had the same crash with gpu_thread < 1. No idea what's causing that. Set to 1 and it will work.

hooke007 commented 10 months ago

Possible driver issues in vk or ncnn. There is one issue in original repo(holywu's rife ncnn vk) said gpu_thread could only be set to 1 to make it work. He finally roll back the version of gpu's driver to fix it.

mafiosnik777 commented 10 months ago

Yeah, that repo is gone now.