Vulkan support

Hello

I’ve been wanting to implement support for Vulkan in CasparCG for a while now. But it’s been difficult to find one single client to fund the effort. Especially since there is no real payback for just reimplementing the accelerator in Vulkan. The payback comes in the form of the new features and optimizations it enables.

I’ve now initiated a sort of fund raising campaign, with the hope to get around that problem. Have a look at https://casparcgvulkan.com if you represent an organisation that would benefit from this effort. And thanks to the kind folks at nxtedition, I’ve already got a substantial contribution towards the initial goal. :tada:

Initial Vulkan support has been made publicly available via PR 1677

This adds a drop-in replacement of the opengl accelerator based on Vulkan. Image mixing should be feature complete (it’s meant to be at least). Support for configuring which accelerator backend to use has been added (defaults to opengl on linux and windows), for easy testing. In the same spirit, an new feature flag, “ENABLE_VULKAN”, has been added to opt-in to building with Vulkan support. Making the feature completely non-intrusive unless you explicitly opt-in.

Very limited compatibility and performance testing has been done. Help with testing of different hardware and platforms are greatly appreciated.

The PR also includes initial macOS support, with some gotchas:

  • Compiles and runs on macos
  • ffmpeg producer and consumer working
  • No real performace testing done yet
  • Issue with OSC that causes CasparCG Client to crash. Use as workaround
  • Only ffmpeg module have been tested so far
  • No screen consumer support yet
  • HTML module not supported yet
  • Documentation not fully updated yet

Hey Niklas!

Super interesting - I’ve got this experiment using ultralight for html graphics instead of CEF to get deterministic frame sync in graphics. There might be a path there to plug your CasparCG Vulcan into the Ultralight renderer for accelerated graphics.

Ultralight is not free for commercial though, but I couldn’t identify other deterministic html-renderers that were.

/ ole

Did anything more happen regarding macOS support?

Yes!

I have it complete and working on my development branch. I’ve started the process of getting it all merged upstream. There are a couple of steps to get that done. But if you build yourself, you can go to the source for now. You can find it here:

It’s not really ready for public yet, I’ve hardly updated any docs. But as far I as can remember all the relevant build flags are set by default. You build it with cmake just like on the other platforms.

There are a couple of packages that you need to have installed, they are hard-coded to homebrew paths in CMakeModules/Bootstrap_Mac.cmake for now, change them if you need to.

If you want a window with a screen consumer, you need to package the built files to an app bundle. There is a script for that. Just run ./tools/macos/package.sh --no-ndi --no-dmg --no-sign --no-notarize from the repo root. Change flags based on needs. run it with the --help flag to see all options. If you don’t need a window, makybe you just have an ffmpeg stream output or decklink, it works just as well to run the executable from the terminal, like on linux.

Thanks, that sounds very promising!

I’m not a developer, and have pretty much a 100% fail rate when trying to build stuff, but maybe I’ll give it a go. Otherwise I’ll wait for an official build.

Thanks again!