预览版推出:LM Link立即开始

LM Studio 0.3.14: 多 GPU 控制 🎛️

2025年3月27日·

LM Studio 0.3.14 为配备 2 个及以上 GPU 的设备带来了全新控制功能

LM Studio 0.3.14 为多 GPU 配置引入了全新的细粒度控制功能。新特性包括:启用/禁用特定 GPU 的能力、选择分配策略(平均分配、优先级顺序)以及将模型权重限制在专用 GPU 显存中。

通过应用内更新进行升级,或前往 https://lm-studio.cn/download 下载。

GPU 资产阶级 🎩

如果您的系统中有超过 1 个 GPU,您可能已经不再被视为“GPU 穷人”了。但能力越大,责任越大。您需要明智地管理您的 GPU,以发挥出它们的最佳性能。

在 LM Studio 0.3.14 中,我们引入了新的调节选项,以帮助您更主动、更好地管理 GPU 资源。其中一些新特性目前仅适用于 NVIDIA GPU。我们正在积极努力,争取尽快将其引入 AMD GPU。

多 GPU 控制

使用 Ctrl+Shift+Alt+H 将其弹出到新窗口中。

要打开 GPU 控制面板,请在 Windows 或 Linux 上按 Ctrl+Shift+H,在 Mac 上按 Cmd+Shift+H。您还可以通过按 Ctrl+Alt+Shift+H/Cmd+Option+Shift+H 在弹出窗口中打开 GPU 控制面板。

随着我们对最佳配置的深入了解,我们的目标是在手动控制的基础上加入自动模式。这些功能目前可通过 LM Studio 的图形界面(GUI)使用,未来还将通过 lms 命令行工具(CLI)提供。

启用或禁用特定 GPU

使用每个 GPU 旁边的开关来启用或禁用它。禁用 GPU 意味着 LM Studio 将不会使用它。如果您同时拥有高性能和低性能的 GPU,或者想为其他任务保留某个 GPU,此功能会非常有用。

视频演示了禁用 GPU 1 然后加载模型的过程。模型仅加载在 GPU 0 上,GPU 1 没有活动。

禁用 GPU 1,仅在 GPU 0 上加载模型

限制模型仅卸载至专用 GPU 显存

目前仅支持 CUDA

大型语言模型(LLM)可能非常消耗显存。通常占用最多显存的组件是模型权重和对话上下文缓冲区。在模型权重太大、无法完全装入单个 GPU 的专用显存的情况下,您的操作系统可能会在共享 GPU 显存中分配内存。这会显著降低运行速度。

视频首先展示了该选项关闭(OFF)时的状态,这会导致内存分配到专用显存和共享内存中。然后,将该选项开启(ON),模型便仅被加载到专用显存中。

限制模型仅卸载至专用 GPU 显存

专用 GPU 显存中的模型权重

“限制模型仅卸载至专用 GPU 显存”模式可确保模型权重仅加载到专用 GPU 显存中。如果模型权重过大,无法完全装入专用 GPU 显存,LM Studio 将自动减少 GPU 卸载大小,以便将模型权重装入专用 GPU 显存,其余部分则放入系统内存(RAM)中。

根据我们的测试,将模型权重分配在专用 GPU 显存系统内存之间,比使用共享 GPU 显存速度更快。如果您的实际体验有所不同,请告诉我们!

上下文可能分配在共享 GPU 显存中

上下文缓冲区可能仍会使用共享内存。假设模型的权重可以装入专用 GPU 显存中,并留有一些剩余空间。模型将全速运行,直到上下文增长并超过剩余的专用显存。随着上下文溢出到共享内存中,性能才会逐渐减慢。这种方法可以带来更快的初始性能,而不是将所有上下文都限制在较慢的系统内存中。

优先级顺序模式

目前仅支持 CUDA

您现在可以设置 GPU 的优先级顺序。这实际意味着

  • 如果您有多个 GPU,可以设置 LM Studio 尝试将模型分配到 GPU 的顺序。
  • 系统会优先尝试在列表中排在前面的 GPU 上分配更多资源。一旦第一个 GPU 满了,它就会移至列表中的下一个,以此类推。

视频演示了加载多个模型的过程。请注意 LM Studio 是如何先填满 GPU 0,然后才开始在 GPU 1 上进行分配的。

按顺序填充模式:按照您指定的 GPU 优先级顺序分配模型

拥有配备 3 个或更多 GPU 的设备?我们很乐意倾听您的反馈!

我们正在寻找能够帮助我们进行测试,并就新功能在此类配置下的表现提供反馈的用户。如果您的系统(Windows 或 Linux)配备了 3 个或更多 GPU,我们非常期待收到您的邮件,地址为:team@lmstudio.ai。谢谢!

0.3.14 - 完整更新说明

**Build 1**

- New: GPU Controls 🎛️
  - On multi-GPU setups, customize how models are offloaded onto your GPUs
    - Enable/disable individual GPUs
    - CUDA-specific features:
      - "Priority order" mode: The system will try to allocate more on GPUs listed first
      - "Limit Model Offload to Dedicated GPU memory" mode: The system will limit offload of model weights to dedicated GPU memory and RAM only. Context may still use shared memory
  - How to open GPU controls:
    - Windows: `Ctrl+Shift+H`
    - Mac: `Cmd+Shift+H`
  - How to open GPU controls in a pop-out window:
    - Windows: `Ctrl+Alt+Shift+H`
    - Mac: `Cmd+Option+Shift+H`
    - Benefit: Manage GPU settings while models are loading
- LG AI EXAONE Deep reasoning model support
- Improved model loader UI in small window sizes
- Improve Llama model family tool call reliability through LM Studio SDK and OpenAI compatible streaming API
- [SDK] Added support for GBNF grammar when using structured generation
- [SDK/RESTful API] Added support for specifying presets
- Fixed a bug where sometimes the last couple fragments of a prediction are lost

**Build 2**

- Optimized "Limit Model Offload to Dedicated GPU memory" mode in long context situations on single GPU setups
- Speculative decoding draft model now respects GPU controls
- [CUDA] Fixed a bug where model would crash with message "Invalid device index"
- [Windows ARM] Fixed chat with document sometimes not working

**Build 3**

- [Advanced GPU controls] Fixed a bug where intermediate buffers were being allocated on disabled GPUs
- Fixed "OpenSquareBracket !== CloseStatement" bug with Nemotron model
- Fixed a bug where Nemotron GGUF model metadata was not being read properly
- [Windows] Fixed: Make sure the LM Studio.exe executable is also signed. Should help with anti-virus false positives

**Build 4**

- [Advanced GPU controls] Allow disabling all GPUs with any engine
- [Advanced GPU controls] Fix bug where disabling a GPU would cause incorrect offloading when > 2 gpus
- [Advanced GPU controls][CUDA] Improved stability of"Limit Model Offload to Dedicated GPU memory" mode
- Added GPU controls logging to "Developer Logs"
- Fixed a bug where sometimes editing model config inside the model loader popover does not take effect
- Fixed a bug related to renaming state focus on chat cells

**Build 5**

- [Advanced GPU controls] Enlarge GPU controls pop-out window

更多内容

© . This site is unofficial and not affiliated with Element Labs, Inc.