feat(gpu): 支持选择 NVIDIA CUDA 显卡 - #412
Open
nightt5879 wants to merge 3 commits into
Open
Conversation
buxuku
self-requested a review
July 30, 2026 07:19
buxuku
requested changes
Jul 30, 2026
buxuku
left a comment
Owner
There was a problem hiding this comment.
感谢 PR,整体方向没问题,UUID 持久化、启动前设 CUDA_VISIBLE_DEVICES、配置导出排除机器本地字段,这些点都合理。
有一个阻断项需要修:
main/background.ts 里删掉了 getGpuEnvironment 的 import,但 252 行还在调用:
void getGpuEnvironment().catch(() => {});打包后这里是裸引用,启动会 ReferenceError。补回 import 就行:
import {
enumerateNvidiaGpus,
getDevSimulationConfig,
getGpuEnvironment,
} from './helpers/cudaUtils';
Contributor
Author
|
已按 review 修复,追加提交: 处理内容:
验证:
感谢指出。 |
buxuku
approved these changes
Jul 30, 2026
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.
变更内容
GPU index + 名称nvidia-smi枚举 CUDA index 与稳定 GPU UUID,并与现有跨平台显卡检测结果合并CUDA_VISIBLE_DEVICES,让 whisper.cpp、faster-whisper 与 sherpa-onnx 子进程统一看到所选显卡为逻辑 GPU 0CUDA_VISIBLE_DEVICES(包括空字符串),切回自动模式时恢复原值范围说明
验证
npm run test:engines:738/738npm run check:i18nnpm run build:Renderer + Main production build 通过git diff --checkCloses #377