diff --git a/Cargo.lock b/Cargo.lock index bd51635ab..5f8e7c031 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -205,6 +205,7 @@ dependencies = [ "derive-new", "dirs 5.0.1", "github-device-flow", + "os_info", "rand", "ratatui", "reqwest", @@ -216,6 +217,7 @@ dependencies = [ "strum_macros", "sysinfo", "wgpu", + "wsl", ] [[package]] @@ -3190,6 +3192,17 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "os_info" +version = "3.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae99c7fa6dd38c7cafe1ec085e804f8f555a2f8659b0dbe03f1f9963a9b51092" +dependencies = [ + "log", + "serde", + "windows-sys 0.52.0", +] + [[package]] name = "os_str_bytes" version = "6.6.1" @@ -5437,6 +5450,12 @@ dependencies = [ "syn 2.0.55", ] +[[package]] +name = "wsl" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dab7ac864710bdea6594becbea5b5050333cf34fefb0dc319567eb347950d4" + [[package]] name = "x11rb" version = "0.13.0" diff --git a/Cargo.toml b/Cargo.toml index 03dd5cbda..93ca7ea05 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -90,9 +90,11 @@ text_placeholder = "0.5.0" pollster = "0.3" wgpu = "0.18.0" -# Burnbench +# Benchmarks and Burnbench arboard = "3.3.2" github-device-flow = "0.2.0" +os_info = "3.8.2" +wsl = "0.1.0" bincode = { version = "2.0.0-rc.3", features = [ "alloc", diff --git a/backend-comparison/Cargo.toml b/backend-comparison/Cargo.toml index df64f8342..4056aecb4 100644 --- a/backend-comparison/Cargo.toml +++ b/backend-comparison/Cargo.toml @@ -34,7 +34,8 @@ clap = { workspace = true } crossterm = { workspace = true, optional = true } derive-new = { workspace = true } dirs = { workspace = true } -github-device-flow = { workspace = true } +github-device-flow = { workspace = true } +os_info = { workspace = true } rand = { workspace = true } ratatui = { workspace = true, optional = true } reqwest = {workspace = true, features = ["blocking", "json"]} @@ -44,6 +45,7 @@ strum = { workspace = true } strum_macros = { workspace = true } sysinfo = { workspace = true, features = ["serde"] } wgpu = { workspace = true } +wsl = { workspace = true } [dev-dependencies] rstest = { workspace = true } diff --git a/backend-comparison/src/persistence/system_info.rs b/backend-comparison/src/persistence/system_info.rs index 6d41e1c5d..dcc2c0c22 100644 --- a/backend-comparison/src/persistence/system_info.rs +++ b/backend-comparison/src/persistence/system_info.rs @@ -8,6 +8,23 @@ use wgpu; pub(crate) struct BenchmarkSystemInfo { cpus: Vec, gpus: Vec, + os: BenchmarkOSInfo, +} + +#[derive(Default, Clone, Serialize, Deserialize)] +pub(crate) struct BenchmarkOSInfo { + name: String, + #[serde(rename = "wsl")] + windows_linux_subsystem: bool, +} + +impl From for BenchmarkOSInfo { + fn from(info: os_info::Info) -> Self { + BenchmarkOSInfo { + name: format!("{}", info), + windows_linux_subsystem: wsl::is_wsl(), + } + } } impl BenchmarkSystemInfo { @@ -15,6 +32,7 @@ impl BenchmarkSystemInfo { Self { cpus: BenchmarkSystemInfo::enumerate_cpus(), gpus: BenchmarkSystemInfo::enumerate_gpus(), + os: BenchmarkOSInfo::from(os_info::get()), } }