Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable gpus #120

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions proto/depot/cloud/v3/machine.proto
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ message RegisterMachineResponse {
optional string vector_config = 18;
optional bool enable_cni = 19;
optional bool use_buildkit_private = 20;
optional bool enable_gpu = 21;
}

// EngineTask represents an instruction to start an engine daemon
Expand Down
6 changes: 6 additions & 0 deletions src/gen/ts/depot/cloud/v3/machine_pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,11 @@ export class RegisterMachineResponse_BuildKitTask extends Message<RegisterMachin
*/
useBuildkitPrivate?: boolean

/**
* @generated from field: optional bool enable_gpu = 21;
*/
enableGpu?: boolean

constructor(data?: PartialMessage<RegisterMachineResponse_BuildKitTask>) {
super()
proto3.util.initPartial(data, this)
Expand Down Expand Up @@ -596,6 +601,7 @@ export class RegisterMachineResponse_BuildKitTask extends Message<RegisterMachin
{no: 18, name: 'vector_config', kind: 'scalar', T: 9 /* ScalarType.STRING */, opt: true},
{no: 19, name: 'enable_cni', kind: 'scalar', T: 8 /* ScalarType.BOOL */, opt: true},
{no: 20, name: 'use_buildkit_private', kind: 'scalar', T: 8 /* ScalarType.BOOL */, opt: true},
{no: 21, name: 'enable_gpu', kind: 'scalar', T: 8 /* ScalarType.BOOL */, opt: true},
])

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): RegisterMachineResponse_BuildKitTask {
Expand Down
5 changes: 5 additions & 0 deletions src/tasks/buildkit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ keepBytes = ${cacheSizeBytes}
env.DEPOT_RESOLVER_CONCURRENCY = task.resolverConcurrency.toString()
}

if (task.enableGpu) {
console.log('Enabling GPU')
env.DEPOT_ENABLE_GPU = 'true'
}

const args = task.enableDebugLogging ? ['--debug'] : []

async function runBuildKit() {
Expand Down