Skip to content

Commit 2f0c622

Browse files
authored
Merge pull request #120 from depot/feat/gpu
feat: enable gpus
2 parents 5646bbd + b622c1d commit 2f0c622

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

proto/depot/cloud/v3/machine.proto

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ message RegisterMachineResponse {
9595
optional string vector_config = 18;
9696
optional bool enable_cni = 19;
9797
optional bool use_buildkit_private = 20;
98+
optional bool enable_gpu = 21;
9899
}
99100

100101
// EngineTask represents an instruction to start an engine daemon

src/gen/ts/depot/cloud/v3/machine_pb.ts

+6
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,11 @@ export class RegisterMachineResponse_BuildKitTask extends Message<RegisterMachin
569569
*/
570570
useBuildkitPrivate?: boolean
571571

572+
/**
573+
* @generated from field: optional bool enable_gpu = 21;
574+
*/
575+
enableGpu?: boolean
576+
572577
constructor(data?: PartialMessage<RegisterMachineResponse_BuildKitTask>) {
573578
super()
574579
proto3.util.initPartial(data, this)
@@ -596,6 +601,7 @@ export class RegisterMachineResponse_BuildKitTask extends Message<RegisterMachin
596601
{no: 18, name: 'vector_config', kind: 'scalar', T: 9 /* ScalarType.STRING */, opt: true},
597602
{no: 19, name: 'enable_cni', kind: 'scalar', T: 8 /* ScalarType.BOOL */, opt: true},
598603
{no: 20, name: 'use_buildkit_private', kind: 'scalar', T: 8 /* ScalarType.BOOL */, opt: true},
604+
{no: 21, name: 'enable_gpu', kind: 'scalar', T: 8 /* ScalarType.BOOL */, opt: true},
599605
])
600606

601607
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): RegisterMachineResponse_BuildKitTask {

src/tasks/buildkit.ts

+5
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ keepBytes = ${cacheSizeBytes}
193193
env.DEPOT_RESOLVER_CONCURRENCY = task.resolverConcurrency.toString()
194194
}
195195

196+
if (task.enableGpu) {
197+
console.log('Enabling GPU')
198+
env.DEPOT_ENABLE_GPU = 'true'
199+
}
200+
196201
const args = task.enableDebugLogging ? ['--debug'] : []
197202

198203
async function runBuildKit() {

0 commit comments

Comments
 (0)