rc/gpu
Use this extension when your workload needs one or more GPUs, for example to run a machine learning model.
In a Condition, you say how many GPUs your workload needs. You can also say how much memory each GPU must have, and which company must make the GPUs. The platform then runs your workload on a machine that has these GPUs, or tells you that it cannot.
A GPU here always means a whole GPU. You cannot ask for part of a GPU. This extension does not say which driver or CUDA version the machine must have.
Documentation
This first candidate release lets a workload declare that it needs one or more
whole GPU devices. interface.count is the minimum number of devices.
interface.minMemoryMiB is the minimum memory per device, in mebibytes
(1 MiB = 1,048,576 bytes). An adapter can use these requirements to select a
compatible node or report that the platform cannot fulfill the workload.
interface.vendor is optional. Set it when the workload requires NVIDIA, AMD,
or Intel GPU hardware; leave it out when any compatible GPU may fulfill the
requirement.
The newest definition is 0.2.0.
The inference example asks for one NVIDIA GPU
with at least 16 GiB of memory, as a CUDA-based image might require.
The vendor field constrains hardware selection; it does not guarantee a
compatible driver or CUDA version. This release does not express driver,
library-version, or partitioning requirements. count means whole devices, not
fractional or partitioned allocation. It also does not prescribe Kubernetes
resource names, node labels, or provisioning technology. Those decisions belong
to the fulfilling platform.
Packages
Install the package for your language to declare this extension's Conditions from your code.
Go
This package version is generated but not published to its registry yet.
go get runtimeconditions.io/x/rc/gpu@v0.2.0
Conditions
Every Condition part this package defines, with the fields you can set. Select a line to open it.
rc.gpu · device: Whole GPUs that your workload can use.
gpu.Device is the interface of a rc.gpu Condition.
| Field | Type | Required | Description |
|---|---|---|---|
Count |
int64 |
yes | How many whole GPUs your workload needs, at least. How many whole GPUs, at least. It must be 1 or more. |
MinMemoryMiB |
*int64 |
no | How much memory each GPU must have, at least, in MiB. For example, 16384 MiB is 16 GiB. How much memory each GPU must have, at least, in MiB. If you set it, it must be 1 or more. |
Vendor |
*Vendor |
no | The company that must make the GPUs. Leave it out if any GPU works. The company that must make the GPUs, if your workload needs one of these. Values: amd: GPUs made by AMD.intel: GPUs made by Intel.nvidia: GPUs made by NVIDIA. |
RcGpu
gpu.RcGpu declares a rc.gpu Condition.
Example: a workload that runs a large model and needs two GPUs.
gpu.RcGpu(
gpu.Device{
Count: 2,
},
)
The full API, with every type, field and constant documented, is in the Go package documentation.
Python
This package version is generated but not published to its registry yet.
pip install runtimeconditions-gpu
Conditions
Every Condition part this package defines, with the fields you can set. Select a line to open it.
rc.gpu · device: Whole GPUs that your workload can use.
Device is the interface of a rc.gpu Condition.
| Field | Type | Required | Description |
|---|---|---|---|
count |
int |
yes | How many whole GPUs your workload needs, at least. How many whole GPUs, at least. It must be 1 or more. |
min_memory_mi_b |
int | None |
no | How much memory each GPU must have, at least, in MiB. For example, 16384 MiB is 16 GiB. How much memory each GPU must have, at least, in MiB. If you set it, it must be 1 or more. |
vendor |
Vendor | None |
no | The company that must make the GPUs. Leave it out if any GPU works. The company that must make the GPUs, if your workload needs one of these. Values: amd: GPUs made by AMD.intel: GPUs made by Intel.nvidia: GPUs made by NVIDIA. |
rc_gpu
rc_gpu declares a rc.gpu Condition.
Example: a workload that runs a large model and needs two GPUs.
from runtimeconditions_gpu import Device, rc_gpu
rc_gpu(Device(count=2))
Every class, field and enum member is documented in the package's docstrings.
TypeScript
This package version is generated but not published to its registry yet.
npm install @runtimeconditions/gpu
Conditions
Every Condition part this package defines, with the fields you can set. Select a line to open it.
rc.gpu · device: Whole GPUs that your workload can use.
Device is the interface of a rc.gpu Condition.
| Field | Type | Required | Description |
|---|---|---|---|
count |
number |
yes | How many whole GPUs your workload needs, at least. How many whole GPUs, at least. It must be 1 or more. |
minMemoryMiB |
number |
no | How much memory each GPU must have, at least, in MiB. For example, 16384 MiB is 16 GiB. How much memory each GPU must have, at least, in MiB. If you set it, it must be 1 or more. |
vendor |
Vendor |
no | The company that must make the GPUs. Leave it out if any GPU works. The company that must make the GPUs, if your workload needs one of these. Values: amd: GPUs made by AMD.intel: GPUs made by Intel.nvidia: GPUs made by NVIDIA. |
rcGpu
rcGpu declares a rc.gpu Condition.
Example: a workload that runs a large model and needs two GPUs.
import { Device, rcGpu } from "@runtimeconditions/gpu";
rcGpu(new Device({ count: 2 }));
Every class, field and enum member is documented in the package's type declarations.
Java
This package version is generated but not published to its registry yet.
<dependency>
<groupId>io.runtimeconditions.bindings</groupId>
<artifactId>runtimeconditions-gpu</artifactId>
<version>0.2.0</version>
</dependency>
Conditions
Every Condition part this package defines, with the fields you can set. Select a line to open it.
rc.gpu · device: Whole GPUs that your workload can use.
Device is the interface of a rc.gpu Condition.
| Field | Type | Required | Description |
|---|---|---|---|
count |
Long |
yes | How many whole GPUs your workload needs, at least. How many whole GPUs, at least. It must be 1 or more. |
minMemoryMiB |
Long |
no | How much memory each GPU must have, at least, in MiB. For example, 16384 MiB is 16 GiB. How much memory each GPU must have, at least, in MiB. If you set it, it must be 1 or more. |
vendor |
Vendor |
no | The company that must make the GPUs. Leave it out if any GPU works. The company that must make the GPUs, if your workload needs one of these. Values: amd: GPUs made by AMD.intel: GPUs made by Intel.nvidia: GPUs made by NVIDIA. |
Bindings.rcGpu
Bindings.rcGpu declares a rc.gpu Condition.
Example: a workload that runs a large model and needs two GPUs.
import io.runtimeconditions.bindings.gpu.Bindings;
import io.runtimeconditions.bindings.gpu.Device;
Bindings.rcGpu(new Device(2L, null, null));
Every record, component and enum constant is documented in the Javadoc.
Kinds
rc.gpu
Your workload needs GPU hardware.
Example: a workload that runs a large model and needs two GPUs.
kind: rc.gpu
interface:
type: device
count: 2
Interface types
Interface types
device
Whole GPUs that your workload can use.
Example: a workload built with CUDA. It needs one NVIDIA GPU with at least 16 GiB of memory.
kind: rc.gpu
interface:
type: device
count: 1
minMemoryMiB: 16384
vendor: nvidia
Fields
interface.countHow many whole GPUs your workload needs, at least.
interface.minMemoryMiBHow much memory each GPU must have, at least, in MiB. For example, 16384 MiB is 16 GiB.
interface.vendorThe company that must make the GPUs. Leave it out if any GPU works.
| Value | Description |
|---|---|
nvidia | GPUs made by NVIDIA. |
amd | GPUs made by AMD. |
intel | GPUs made by Intel. |