fix system cudart detection on linux

This commit is contained in:
Thien Tran 2025-06-04 08:59:24 +08:00 committed by Louis
parent ae349159ce
commit 525cc93d4a
No known key found for this signature in database
GPG Key ID: 44FA9F4D33C37DE2

View File

@ -242,9 +242,18 @@ async function _isCudaInstalled(version: string): Promise<boolean> {
const libname = libnameLookup[key] const libname = libnameLookup[key]
// check from system libraries first // check from system libraries first
// TODO: need to check for CuBLAS and CuBLASLt as well // TODO: might need to check for CuBLAS and CuBLASLt as well
if (await invoke<boolean>('is_library_available', { library: libname })) if (os_type === 'linux') {
return true // not sure why libloading cannot find library from name alone
// using full path here
const libPath = `/usr/local/cuda/lib64/${libname}`
if (await invoke<boolean>('is_library_available', { library: libPath }))
return true
} else if (os_type === 'windows') {
// TODO: test this on Windows
if (await invoke<boolean>('is_library_available', { library: libname }))
return true
}
// check for libraries shipped with Jan's llama.cpp extension // check for libraries shipped with Jan's llama.cpp extension
const janDataFolderPath = await getJanDataFolderPath() const janDataFolderPath = await getJanDataFolderPath()