-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NativeApi: TryLoadLibrary()
can fail for some systems
#524
Comments
This comment was marked as outdated.
This comment was marked as outdated.
What is this method returning for your system? |
I have a little more info.... my environment variables are signaling to use cuda 12 LLamaSharp/LLama/Native/NativeApi.Load.cs Lines 66 to 74 in 3d7bf42
ha! we converged on the same thing at the same time I'm going to uninstall this and see what happens ... |
Success! 🚀 Uninstalling the NVIDIA CUDA toolkit automatically deleted the Thanks so much for your input along the way! I wonder if there's something we can do to detect this issue and show a more helpful error message to the user when the cuda DLL is detected but it can't be used because the available hardware doesn't support it. I'd love to add that logic right here: LLamaSharp/LLama/Native/NativeApi.Load.cs Lines 321 to 331 in 3d7bf42
|
My system does not have a cuda-supported graphics card, but LLamaSharp's native API class detects cuda version 12.
The result is that the first time I try to interact with a LLM, I get an exception:
Details
Note that this file is present in my build folder (which is why cuda 12 is "detected"), but the only graphics card on my system is a GeForce GT 710 which I don't think supports cuda 11 or 12
This is the code that runs "successfully", deciding that I should be running cuda 12 because it found the DLL and loaded it
LLamaSharp/LLama/Native/NativeApi.Load.cs
Lines 321 to 331 in 3d7bf42
Possible Solution: Interact with cuda before "succeeding"?
Perhaps
TryLoad()
shouldn't blindly return the pointer, but rather actually load the library and interact with it (e.g., gettingContextSize
without crashing) before indicating that the loading was successful. I tried to figure out how to do this without loading a heavy model (maybe there's a dummy model or something used for testing?) but haven't been able to figure that out yet. I'll keep poking at this issue, but I welcome feedback in case anyone has suggestions!The text was updated successfully, but these errors were encountered: