LLamaSharp icon indicating copy to clipboard operation
LLamaSharp copied to clipboard

How to handle `CUDA error: out of memory`?

Open yukozh opened this issue 1 year ago • 2 comments

Description

CUDA error: out of memory, the whole process terminated.

Is there a way to catch this error instead of terminate the process?

yukozh avatar Jul 06 '24 13:07 yukozh

LLamaSharp catches llama.cpp error codes where possible, and turns them into C# exceptions that you can handle in the normal way. However, some errors in C++ simply abort the process with no possibility for C# to catch it. This looks like one of those cases.

I would suggest adding a comment this this issue with as much detail about the error as possible. In particular a stack trace, if you can get one, otherwise at least trace through the C# code to where it calls a native C++ method.

martindevans avatar Jul 06 '24 16:07 martindevans

This issue has been automatically marked as stale due to inactivity. If no further activity occurs, it will be closed in 7 days.

github-actions[bot] avatar Apr 30 '25 00:04 github-actions[bot]