Mark plugins as gpu capable
Since many plugins also use the GPU for processing, it would be nice to mark packages accordingly.
I was thinking something like this:
{
"name": "MyPlugin",
"type": "VSPlugin",
"gpu": "CUDA",
....
Maybe CUDA, VULKAN & OPENCL as options. Or simply uses_gpu: yes I don't think it makes much sense to mark it per release.
This would be then listed in vsrepo available / installed
What do you think?
You should definitely mark the gpu apis supported in a list (are there multi api plugins? if not maybe skip that) since not all cards do CUDA. There should probably be a "cpu": true/false (assume true if not set) option to mark gpu only properly. Is there some way we can detect nvidia gpus easily from python? Check for the existence of a cuda dll in system maybe? That way we can skip CUDA only on non-nvidia systems.
Or a more general option like device: ["cpu", "opencl"] where once again cpu only is assumed when not present.
device sounds good, since there are plugins with both cpu and gpu support. Hmm not sure how to check for cuda. Maybe with some clever "list gpu devices" and then look for a cuda string? Via WMI on Windows maybe?
There's also torch.cuda.is_available() but it's a "heavy" dependency.
Found this https://gist.github.com/f0k/63a664160d016a491b2cbea15913d549#file-cuda_check-py-L60. Maybe looking for a cuda dll is enough?
nvcuda.dll should be our dll
Yes, nvcuda.dll existing sounds like enough.
Step 1 is commited (just the tagging part) https://github.com/vapoursynth/vsrepo/commit/bbf823304c48f97298c9980e4c36ba976f36e503