fix: clarify that ORT CUDA binaries are linux/x64 only

ORT 1.24.x downloads CUDA provider .so from NuGet at postinstall,
but only for linux/x64. The process.arch guard correctly returns
false on arm64 (safe CPU fallback), but the prior comment implied
arm64 CUDA was supported. Clarify the actual state.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jim Park 2026-03-21 17:30:23 -07:00
parent 60265c1d0d
commit 56356b71db

View file

@ -38,7 +38,9 @@ function hasOrtCudaProvider(): boolean {
const transformersDir = dirname(require.resolve('@huggingface/transformers/package.json'));
const ortRequire = createRequire(join(transformersDir, 'package.json'));
const ortPath = dirname(ortRequire.resolve('onnxruntime-node/package.json'));
const arch = process.arch; // x64, arm64, etc.
// ORT 1.24.x only ships CUDA binaries for linux/x64 (downloaded from NuGet
// at postinstall). arm64 will correctly return false here until ORT adds support.
const arch = process.arch;
return existsSync(join(ortPath, 'bin', 'napi-v6', 'linux', arch, 'libonnxruntime_providers_cuda.so'));
} catch {
return false;