Skip to content

common_fit_params: failed to fit params to free device memory — n_gpu_layers set to 999999, abort (AMD RX 9060 XT) #2138

Description

@titansonico10

Which version of LM Studio?

LM Studio 0.4.18

Which operating system?

Windows 11

What is the bug?

When loading a model, LM Studio logs a warning from common_fit_params indicating it failed to fit parameters to free device memory because n_gpu_layers was already set by the user to 999999, causing an abort.

Model

gemma4-12b

GPU

AMD RX 9060 XT — 16 GB VRAM

Logs

2026-07-04 00:23:03 [DEBUG]
 0.03.913.323 W common_fit_params: failed to fit params to free device memory: n_gpu_layers already set by user to 999999, abort

Expected behavior

LM Studio should either adjust n_gpu_layers automatically to fit available VRAM, or show a clear user-facing error instead of silently aborting the param fitting process.

Additional context

The value 999999 for n_gpu_layers appears to be a sentinel/default value used by LM Studio to mean "offload all layers". When the automatic fitting logic detects this user-set value, it aborts instead of falling back gracefully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions