Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Only allocate GPU if requirements need it (#102)
Browse files Browse the repository at this point in the history
Now that it's possible to provide program specific resource
requirements, the GPU should be only allocated when it's requested.

There's still plenty of room for improvement here (mainly allocating
the right amount and fee GPUs), but this quick fix should help for
the most immediate issues.
  • Loading branch information
tuommaki authored Feb 22, 2024
1 parent 87664d5 commit f246a34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/node/src/vmm/qemu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ impl Provider for Qemu {
.args(["-qmp", &format!("tcp:localhost:{qmp_port},server")]);

// TODO: When GPU argument handling is refactored, this should be fixed as well.
if self.config.gpu_devices.is_some() {
if self.config.gpu_devices.is_some() && req.gpus > 0 {
cmd.args(parse_gpu_devices_into_qemu_params(
self.config.gpu_devices.as_ref().unwrap(),
));
Expand Down

0 comments on commit f246a34

Please sign in to comment.