vsrepo icon indicating copy to clipboard operation
vsrepo copied to clipboard

Mark plugins as gpu capable

Open theChaosCoder opened this issue 4 years ago • 6 comments

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?

theChaosCoder avatar Sep 26 '21 10:09 theChaosCoder

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.

myrsloik avatar Sep 26 '21 11:09 myrsloik

Or a more general option like device: ["cpu", "opencl"] where once again cpu only is assumed when not present.

myrsloik avatar Sep 26 '21 11:09 myrsloik

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.

theChaosCoder avatar Sep 26 '21 11:09 theChaosCoder

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

theChaosCoder avatar Sep 26 '21 11:09 theChaosCoder

Yes, nvcuda.dll existing sounds like enough.

myrsloik avatar Sep 26 '21 12:09 myrsloik

Step 1 is commited (just the tagging part) https://github.com/vapoursynth/vsrepo/commit/bbf823304c48f97298c9980e4c36ba976f36e503

theChaosCoder avatar Oct 31 '21 13:10 theChaosCoder