cv-rs icon indicating copy to clipboard operation
cv-rs copied to clipboard

CUDA not available causes SIGSEV

Open vadixidav opened this issue 6 years ago • 1 comments

When CUDA is not available at runtime, but cv-rs is built with the "cuda" feature enabled, then the program emits this message: OpenCV(3.4.1) Error: Gpu API call (no CUDA-capable device is detected) in allocate. Then an exception is thrown with that error which is not caught and blows up the stack. We need to catch exceptions for when CUDA is not available and either panic! on the Rust side, or give Result back via the API.

vadixidav avatar Mar 28 '19 18:03 vadixidav

CResutlt has relevant method to catch it. We could just use it. Panic may be a bad thing since GPU may appear after (e.g. dynamic videocard switch on laptop).

Pzixel avatar Mar 28 '19 21:03 Pzixel