We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4631d94 commit 5c02ae8Copy full SHA for 5c02ae8
2 files changed
vmm/rpc/src/lib.rs
@@ -7,3 +7,12 @@ extern crate alloc;
7
pub use generated::*;
8
9
mod generated;
10
+
11
+impl GpuConfig {
12
+ pub fn is_empty(&self) -> bool {
13
+ if self.attach_mode == "all" {
14
+ return false;
15
+ }
16
+ self.gpus.is_empty()
17
18
+}
vmm/src/main_service.rs
@@ -66,7 +66,7 @@ pub fn resolve_gpus_with_config(
66
gpu_cfg: &rpc::GpuConfig,
67
cvm_config: &crate::config::CvmConfig,
68
) -> Result<GpuConfig> {
69
- if !cvm_config.gpu.enabled {
+ if !cvm_config.gpu.enabled && !gpu_cfg.is_empty() {
70
bail!("GPU is not enabled");
71
}
72
let gpus = resolve_gpus(gpu_cfg)?;
0 commit comments