Skip to main content

LiumGpuOperationError

from lium.sdk import LiumGpuOperationError

Defined in lium.sdk.exceptions.

A GPU reset or clock change ran on the node and failed (a reset's status failed, or a 409, that lists gpus).

Inspect gpus and container_restarted: the container can fail to restart even when every GPU reset succeeds.

gpus is each GPU's outcome (GpuResetOutcome from reset_gpu(), GpuClockOutcome from lock_gpu_clocks() / reset_gpu_clocks()), so the caller sees which GPUs failed and which stay locked; container_restarted says whether a reset started the pod's container again (None when the server did not say, always for clocks). code is the API's (reset_not_supported, ...).

LiumGpuOperationError(
message: str,
*,
gpus: list[lium.sdk.models.GpuResetOutcome | lium.sdk.models.GpuClockOutcome] | None = None,
container_restarted: bool | None = None,
code: str | None = None,
hint: str | None = None,
request_id: str | None = None
)

Catching it​

LiumGpuOperationError subclasses LiumError → Exception, so a handler for any of those also catches it.

from lium.sdk import LiumGpuOperationError

try:
... # any SDK call
except LiumGpuOperationError as e:
print(e, e.code, e.hint, e.request_id)
FieldMeaning
codemachine-readable error code from the API, when it sent one
hintwhat to try next, when the API suggested something
request_idthe API request id; quote it when you contact support