fix: 🐛 Fix dashboard crash on Windows
This commit is contained in:
parent
90dc78df35
commit
08c593d6d3
|
@ -113,17 +113,6 @@ dependencies = [
|
|||
"cpufeatures",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ahash"
|
||||
version = "0.7.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47"
|
||||
dependencies = [
|
||||
"getrandom",
|
||||
"once_cell",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ahash"
|
||||
version = "0.8.3"
|
||||
|
@ -144,6 +133,12 @@ dependencies = [
|
|||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "allocator-api2"
|
||||
version = "0.2.16"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5"
|
||||
|
||||
[[package]]
|
||||
name = "alsa"
|
||||
version = "0.7.1"
|
||||
|
@ -284,6 +279,7 @@ dependencies = [
|
|||
"ureq",
|
||||
"wasm-bindgen-futures",
|
||||
"wasm-logger",
|
||||
"wgpu",
|
||||
"winres",
|
||||
]
|
||||
|
||||
|
@ -387,7 +383,6 @@ dependencies = [
|
|||
"encoding_rs_io",
|
||||
"runas",
|
||||
"serde_json",
|
||||
"wgpu",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1530,7 +1525,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "a3aef8ec3ae1b772f340170c65bf27d5b8c28f543a0116c844d2ac08d01123e7"
|
||||
dependencies = [
|
||||
"accesskit",
|
||||
"ahash 0.8.3",
|
||||
"ahash",
|
||||
"epaint",
|
||||
"log",
|
||||
"nohash-hasher",
|
||||
|
@ -1642,7 +1637,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "09333964d4d57f40a85338ba3ca5ed4716070ab184dcfed966b35491c5c64f3b"
|
||||
dependencies = [
|
||||
"ab_glyph",
|
||||
"ahash 0.8.3",
|
||||
"ahash",
|
||||
"atomic_refcell",
|
||||
"bytemuck",
|
||||
"ecolor",
|
||||
|
@ -2194,22 +2189,22 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gpu-descriptor"
|
||||
version = "0.2.3"
|
||||
version = "0.2.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b0c02e1ba0bdb14e965058ca34e09c020f8e507a760df1121728e0aef68d57a"
|
||||
checksum = "cc11df1ace8e7e564511f53af41f3e42ddc95b56fd07b3f4445d2a6048bc682c"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"bitflags 2.4.0",
|
||||
"gpu-descriptor-types",
|
||||
"hashbrown 0.12.3",
|
||||
"hashbrown 0.14.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gpu-descriptor-types"
|
||||
version = "0.1.1"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "363e3677e55ad168fef68cf9de3a4a310b53124c5e784c53a1d70e92d23f2126"
|
||||
checksum = "6bf0b36e6f090b7e1d8a4b49c0cb81c1f8376f72198c65dd3ad9ff3556b8b78c"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"bitflags 2.4.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2254,15 +2249,16 @@ name = "hashbrown"
|
|||
version = "0.12.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
|
||||
dependencies = [
|
||||
"ahash 0.7.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hashbrown"
|
||||
version = "0.14.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a"
|
||||
dependencies = [
|
||||
"ahash",
|
||||
"allocator-api2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hassle-rs"
|
||||
|
@ -3683,9 +3679,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "profiling"
|
||||
version = "1.0.10"
|
||||
version = "1.0.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "45f10e75d83c7aec79a6aa46f897075890e156b105eebe51cfa0abce51af025f"
|
||||
checksum = "f89dff0959d98c9758c88826cc002e2c3d0b9dfac4139711d1f30de442f1139b"
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
|
@ -4869,9 +4865,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "unicode-width"
|
||||
version = "0.1.10"
|
||||
version = "0.1.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b"
|
||||
checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-xid"
|
||||
|
|
|
@ -39,5 +39,8 @@ instant = { version = "0.1", features = ["wasm-bindgen"] }
|
|||
wasm-bindgen-futures = "0.4"
|
||||
wasm-logger = "0.2"
|
||||
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
wgpu = "0.16"
|
||||
|
||||
[target.'cfg(windows)'.build-dependencies]
|
||||
winres = "0.1"
|
||||
|
|
|
@ -22,7 +22,6 @@ use dashboard::Dashboard;
|
|||
#[cfg(not(target_arch = "wasm32"))]
|
||||
fn main() {
|
||||
use alvr_common::ALVR_VERSION;
|
||||
use alvr_packets::GpuVendor;
|
||||
use eframe::{egui, IconData, NativeOptions};
|
||||
use ico::IconDir;
|
||||
use std::{env, fs};
|
||||
|
@ -36,16 +35,22 @@ fn main() {
|
|||
|
||||
data_manager.clean_client_list();
|
||||
|
||||
if data_manager
|
||||
.get_gpu_vendors()
|
||||
.iter()
|
||||
.any(|vendor| matches!(vendor, GpuVendor::Nvidia))
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
data_manager
|
||||
.session_mut()
|
||||
.session_settings
|
||||
.patches
|
||||
.linux_async_reprojection = false;
|
||||
let has_nvidia = wgpu::Instance::new(wgpu::InstanceDescriptor {
|
||||
backends: wgpu::Backends::VULKAN,
|
||||
dx12_shader_compiler: Default::default(),
|
||||
})
|
||||
.enumerate_adapters(wgpu::Backends::VULKAN)
|
||||
.any(|adapter| adapter.get_info().vendor == 0x10de);
|
||||
|
||||
if has_nvidia {
|
||||
data_manager
|
||||
.session_mut()
|
||||
.session_settings
|
||||
.patches
|
||||
.linux_async_reprojection = false;
|
||||
}
|
||||
}
|
||||
|
||||
if data_manager.session().server_version != *ALVR_VERSION {
|
||||
|
|
|
@ -138,12 +138,6 @@ pub struct AudioDevicesList {
|
|||
pub input: Vec<String>,
|
||||
}
|
||||
|
||||
pub enum GpuVendor {
|
||||
Nvidia,
|
||||
Amd,
|
||||
Other,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub enum PathSegment {
|
||||
Name(String),
|
||||
|
|
|
@ -18,4 +18,3 @@ encoding_rs_io = "0.1"
|
|||
dirs = "5"
|
||||
runas = "=1.0"
|
||||
serde_json = "1"
|
||||
wgpu = "0.16"
|
||||
|
|
|
@ -11,7 +11,7 @@ use alvr_common::{
|
|||
error, info,
|
||||
};
|
||||
use alvr_events::EventType;
|
||||
use alvr_packets::{AudioDevicesList, ClientListAction, GpuVendor, PathSegment, PathValuePair};
|
||||
use alvr_packets::{AudioDevicesList, ClientListAction, PathSegment, PathValuePair};
|
||||
use alvr_session::{ClientConnectionConfig, ConnectionState, SessionConfig, Settings};
|
||||
use cpal::traits::{DeviceTrait, HostTrait};
|
||||
use serde_json as json;
|
||||
|
@ -21,7 +21,6 @@ use std::{
|
|||
ops::{Deref, DerefMut},
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
use wgpu::AdapterInfo;
|
||||
|
||||
fn save_session(session: &SessionConfig, path: &Path) -> Result<()> {
|
||||
fs::write(path, json::to_string_pretty(session)?)?;
|
||||
|
@ -66,7 +65,6 @@ pub struct ServerDataManager {
|
|||
session: SessionConfig,
|
||||
settings: Settings,
|
||||
session_path: PathBuf,
|
||||
gpu_infos: Vec<AdapterInfo>,
|
||||
}
|
||||
|
||||
impl ServerDataManager {
|
||||
|
@ -75,23 +73,10 @@ impl ServerDataManager {
|
|||
fs::create_dir_all(config_dir).ok();
|
||||
let session_desc = Self::load_session(session_path, config_dir);
|
||||
|
||||
let vk_adapters: Vec<wgpu::Adapter> = wgpu::Instance::new(wgpu::InstanceDescriptor {
|
||||
backends: wgpu::Backends::VULKAN,
|
||||
dx12_shader_compiler: Default::default(),
|
||||
})
|
||||
.enumerate_adapters(wgpu::Backends::VULKAN)
|
||||
.collect();
|
||||
|
||||
let gpu_infos = vk_adapters
|
||||
.iter()
|
||||
.map(|adapter| adapter.get_info())
|
||||
.collect();
|
||||
|
||||
Self {
|
||||
session: session_desc.clone(),
|
||||
settings: session_desc.to_settings(),
|
||||
session_path: session_path.to_owned(),
|
||||
gpu_infos,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -303,26 +288,6 @@ impl ServerDataManager {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn get_gpu_vendors(&self) -> Vec<GpuVendor> {
|
||||
return self
|
||||
.gpu_infos
|
||||
.iter()
|
||||
.map(|adapter_info| match adapter_info.vendor {
|
||||
0x10de => GpuVendor::Nvidia,
|
||||
0x1002 => GpuVendor::Amd,
|
||||
_ => GpuVendor::Other,
|
||||
})
|
||||
.collect();
|
||||
}
|
||||
|
||||
pub fn get_gpu_names(&self) -> Vec<String> {
|
||||
return self
|
||||
.gpu_infos
|
||||
.iter()
|
||||
.map(|adapter_info| adapter_info.name.clone())
|
||||
.collect();
|
||||
}
|
||||
|
||||
#[cfg_attr(not(target_os = "linux"), allow(unused_variables))]
|
||||
pub fn get_audio_devices_list(&self) -> Result<AudioDevicesList> {
|
||||
#[cfg(target_os = "linux")]
|
||||
|
|
Loading…
Reference in New Issue