mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix(ai-bundles): stop CPU onnxruntime from clobbering onnxruntime-gpu (#544)
Both PyPI onnxruntime flavors unpack into the same site-packages directory, so a bundle carrying the CPU build (transcription, via faster-whisper) overwrote the GPU build's native libraries during install while the stale onnxruntime_gpu dist-info kept claiming otherwise. Every ONNX-backed tool then silently ran on CPU. The installer now reconciles the flavor before the venv merge and the GPU build always wins, in both install orders; reinstalling any GPU bundle repairs a previously clobbered venv. gpu.py's warning now says exactly that. Build-side, build-bundle.sh gains the same reconcile and verify-bundle-compatibility.sh layers bundles through the real installer merge and asserts a single flavor. Verified live on an RTX 4070 against the published bundles: reproduced the clobber with the stock installer, then confirmed both the prevention and repair paths with the patched one. Fixes #490
This commit is contained in:
@@ -168,8 +168,10 @@ def onnx_providers():
|
||||
available = _ort.get_available_providers()
|
||||
if "CUDAExecutionProvider" in available:
|
||||
return (["CUDAExecutionProvider", "CPUExecutionProvider"], "cuda")
|
||||
emit_info("GPU detected by torch but CUDAExecutionProvider not available in onnxruntime "
|
||||
"-- install onnxruntime-gpu for GPU acceleration")
|
||||
emit_info("GPU detected by torch but CUDAExecutionProvider is missing from onnxruntime. "
|
||||
"A bundle install likely replaced onnxruntime-gpu with the CPU build (#490); "
|
||||
"reinstall the Background Removal bundle from Settings > AI Features to "
|
||||
"restore the GPU build")
|
||||
except ImportError:
|
||||
emit_info("onnxruntime not installed, cannot check CUDA provider")
|
||||
emit_info("No GPU detected, processing on CPU")
|
||||
|
||||
Reference in New Issue
Block a user