yuygfgg
17th October 2024, 15:18
Exploring Metal GPU Plugins for VapourSynth on Apple Silicon
Hi all,
I'm encoding primarily on Apple Silicon Macs. The challenge I've encountered is that these GPUs only support Apple's proprietary Metal API, whereas many existing VapourSynth GPU plugins rely on CUDA or HIP, which aren't supported on macOS. Moreover, SYCL doesn't offer a Metal backend, and as far as I know, there are no GPU-based VapourSynth plugins utilizing Metal on Apple Silicon (though a few OpenCL 1.2 plugins do exist).
Recently, I started experimenting with Metal-based GPU plugins and developed a prototype based on the CUDA plugin vs-fgrain-cuda (https://github.com/AmusementClub/vs-fgrain-cuda). I chose fgrain because it's one of the simplest GPU plugins, making it a suitable candidate for my initial research and experimentation. My Metal port, vs-fgrain-metal (https://github.com/yuygfgg/vs-fgrain-metal), serves as my first attempt at creating a Metal GPU plugin for VapourSynth. The plugin is functional, though still in its very early stages.
Technical Details:
I used C++ for the VapourSynth interface, Objective-C for bridging, Swift for the host-side logic, and Metal for GPU operations.
I'm aware of metal-cpp, which allows for GPU programming directly in C++ without needing Objective-C or Swift. However, I opted for this approach since AI tools provide better assistance with Swift and Objective-C code.
Given that I'm new to programming (like 3 days in GPU programming, 3 months since start coding), any feedback, suggestions, or best practices would be greatly appreciated!
PS. I get "duplicated thread" warning while trying to post it, but I can't find the dupe one; what happened?
Hi all,
I'm encoding primarily on Apple Silicon Macs. The challenge I've encountered is that these GPUs only support Apple's proprietary Metal API, whereas many existing VapourSynth GPU plugins rely on CUDA or HIP, which aren't supported on macOS. Moreover, SYCL doesn't offer a Metal backend, and as far as I know, there are no GPU-based VapourSynth plugins utilizing Metal on Apple Silicon (though a few OpenCL 1.2 plugins do exist).
Recently, I started experimenting with Metal-based GPU plugins and developed a prototype based on the CUDA plugin vs-fgrain-cuda (https://github.com/AmusementClub/vs-fgrain-cuda). I chose fgrain because it's one of the simplest GPU plugins, making it a suitable candidate for my initial research and experimentation. My Metal port, vs-fgrain-metal (https://github.com/yuygfgg/vs-fgrain-metal), serves as my first attempt at creating a Metal GPU plugin for VapourSynth. The plugin is functional, though still in its very early stages.
Technical Details:
I used C++ for the VapourSynth interface, Objective-C for bridging, Swift for the host-side logic, and Metal for GPU operations.
I'm aware of metal-cpp, which allows for GPU programming directly in C++ without needing Objective-C or Swift. However, I opted for this approach since AI tools provide better assistance with Swift and Objective-C code.
Given that I'm new to programming (like 3 days in GPU programming, 3 months since start coding), any feedback, suggestions, or best practices would be greatly appreciated!
PS. I get "duplicated thread" warning while trying to post it, but I can't find the dupe one; what happened?