fix: whisper breaking on cuda-13 (use absolute path for CUDA directory detection)#8678
Merged
mudler merged 1 commit intomudler:masterfrom Feb 28, 2026
Merged
Conversation
The capability detection was using a relative path 'usr/local/cuda-13' which doesn't work when LocalAI is run from a different working directory. This caused whisper (and other backends) to fail on CUDA-13 containers because the system incorrectly detected 'nvidia' capability instead of 'nvidia-cuda-13', leading to wrong backend selection (cuda12-whisper instead of cuda13-whisper). Fixes: mudler#8033
✅ Deploy Preview for localai ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
mudler
approved these changes
Feb 28, 2026
localai-bot
added a commit
to localai-bot/LocalAI
that referenced
this pull request
Mar 25, 2026
…y detection) (mudler#8678) fix: use absolute path for CUDA directory detection The capability detection was using a relative path 'usr/local/cuda-13' which doesn't work when LocalAI is run from a different working directory. This caused whisper (and other backends) to fail on CUDA-13 containers because the system incorrectly detected 'nvidia' capability instead of 'nvidia-cuda-13', leading to wrong backend selection (cuda12-whisper instead of cuda13-whisper). Fixes: mudler#8033 Co-authored-by: localai-bot <localai-bot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The whisper backend (and other CUDA backends) were failing on CUDA-13 containers because the system capability detection was using a relative path
usr/local/cuda-13instead of an absolute path/usr/local/cuda-13.When LocalAI runs from a different working directory, the relative path check fails, causing the system to incorrectly detect
nvidiacapability instead ofnvidia-cuda-13. This leads to wrong backend selection - loadingcuda12-whisperinstead ofcuda13-whisper, which then fails with:Root Cause
In
pkg/system/capabilities.go, theinit()function checks for CUDA directories using:This creates a relative path
usr/local/cuda-13which only works if the current working directory is/.Fix
Changed to use absolute path by prefixing with
os.PathSeparator:This ensures the path is always
/usr/local/cuda-13regardless of the current working directory.Testing
The fix has been verified to compile successfully. The change is minimal and follows Go best practices for cross-platform path handling.
Related Issues