sandrohanea / whisper.net

Whisper.net. Speech to text made simple using Whisper Models
MIT License
506 stars 77 forks source link

Switching between CPU and GPU at runtime #114

Open AshD opened 9 months ago

AshD commented 9 months ago

I am writing a Windows WPF desktop x64 app.

How do I switch between Whisper.net.Runtime and Whisper.net.Runtime.Clblast, if the end user has a GPU or not.

Is there a way that Whisper.net can dynamically switch and choose the best runtime for performance after checking if it's a Nvidia, AMD or no GPU present?

Thanks, Ash

sandrohanea commented 9 months ago

Hello @AshD, Currently this thing is not supported.

In order to create such a thing, the loader + some new package which includes all runtimes needs to be created.

AshD commented 9 months ago

Thanks Sandro. I can test this when it is ready.

The LlamaSharp team did something similar by trying to load different Llama.cpp dlls starting with Cuda12, Cuda11 to CPU variants. https://github.com/SciSharp/LLamaSharp/commit/10678a83d622e5b7cb5355e42486c24f74cdad4a

lilhoser commented 4 months ago

+1

dfengpo commented 1 week ago

+1