-
-
Notifications
You must be signed in to change notification settings - Fork 507
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(linux, steamvr-launcher): Improve logging for gpu checks, add more checks, update wiki #2648
Changes from 5 commits
2c4555d
271476c
b70874d
ae53267
722780b
38a5612
7048a82
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,59 +76,124 @@ pub fn linux_hardware_checks() { | |
adapter.get_info().device_type == wgpu::DeviceType::DiscreteGpu | ||
|| adapter.get_info().device_type == wgpu::DeviceType::IntegratedGpu | ||
}) | ||
.map(|adapter| match adapter.get_info().vendor { | ||
0x10de => DeviceInfo::Nvidia, | ||
0x1002 => DeviceInfo::Amd { | ||
device_type: adapter.get_info().device_type, | ||
}, | ||
0x8086 => DeviceInfo::Intel { | ||
device_type: adapter.get_info().device_type, | ||
}, | ||
_ => DeviceInfo::Unknown, | ||
.map(|adapter| { | ||
let vendor = match adapter.get_info().vendor { | ||
0x10de => DeviceInfo::Nvidia, | ||
0x1002 => DeviceInfo::Amd { | ||
device_type: adapter.get_info().device_type, | ||
}, | ||
0x8086 => DeviceInfo::Intel { | ||
device_type: adapter.get_info().device_type, | ||
}, | ||
_ => DeviceInfo::Unknown, | ||
}; | ||
|
||
(adapter, vendor) | ||
}) | ||
.collect::<Vec<_>>(); | ||
linux_hybrid_gpu_checks(&device_infos); | ||
linux_gpu_checks(&device_infos); | ||
linux_encoder_checks(&device_infos); | ||
} | ||
|
||
fn linux_hybrid_gpu_checks(device_infos: &[DeviceInfo]) { | ||
fn linux_gpu_checks(device_infos: &[(&wgpu::Adapter, DeviceInfo)]) { | ||
let have_igpu = device_infos.iter().any(|gpu| { | ||
gpu == &DeviceInfo::Amd { | ||
device_type: wgpu::DeviceType::IntegratedGpu, | ||
} || gpu | ||
== &DeviceInfo::Intel { | ||
gpu.1 | ||
== DeviceInfo::Amd { | ||
device_type: wgpu::DeviceType::IntegratedGpu, | ||
} | ||
|| gpu.1 | ||
== DeviceInfo::Intel { | ||
device_type: wgpu::DeviceType::IntegratedGpu, | ||
} | ||
}); | ||
debug!("have_igpu: {}", have_igpu); | ||
let have_nvidia_dgpu = device_infos.iter().any(|gpu| gpu == &DeviceInfo::Nvidia); | ||
|
||
let have_nvidia_dgpu = device_infos.iter().any(|gpu| gpu.1 == DeviceInfo::Nvidia); | ||
debug!("have_nvidia_dgpu: {}", have_nvidia_dgpu); | ||
|
||
let have_amd_igpu = device_infos.iter().any(|gpu| { | ||
gpu.1 | ||
== DeviceInfo::Amd { | ||
device_type: wgpu::DeviceType::IntegratedGpu, | ||
} | ||
}); | ||
debug!("have_amd_igpu: {}", have_amd_igpu); | ||
The-personified-devil marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
let have_amd_dgpu = device_infos.iter().any(|gpu| { | ||
gpu == &DeviceInfo::Amd { | ||
device_type: wgpu::DeviceType::DiscreteGpu, | ||
} | ||
gpu.1 | ||
== DeviceInfo::Amd { | ||
device_type: wgpu::DeviceType::DiscreteGpu, | ||
} | ||
}); | ||
debug!("have_amd_dgpu: {}", have_amd_dgpu); | ||
let have_intel_dgpu = device_infos.iter().any(|gpu| { | ||
gpu == &DeviceInfo::Intel { | ||
device_type: wgpu::DeviceType::DiscreteGpu, | ||
|
||
if have_amd_igpu || have_amd_dgpu { | ||
let is_any_amd_driver_invalid = device_infos.iter().any(|gpu| { | ||
info!("Driver name: {}", gpu.0.get_info().driver); | ||
match gpu.0.get_info().driver.as_str() { | ||
"AMD proprietary driver" | "AMD open-source driver" => true, // AMDGPU-Pro | AMDVLK | ||
_ => false, | ||
} | ||
}); | ||
if is_any_amd_driver_invalid { | ||
error!("Amdvlk or amdgpu-pro vulkan drivers detected, SteamVR may not function properly. \ | ||
Please remove them or make them unavailable for SteamVR and games you're trying to launch. \ | ||
For more detailed info visit wiki: https://github.com/alvr-org/ALVR/wiki/Linux-Troubleshooting#artifacting-no-steamvr-overlay-or-graphical-glitches-in-streaming-view") | ||
} | ||
} | ||
|
||
let have_intel_dgpu = device_infos.iter().any(|gpu| { | ||
gpu.1 | ||
== DeviceInfo::Intel { | ||
device_type: wgpu::DeviceType::DiscreteGpu, | ||
} | ||
}); | ||
debug!("have_intel_dgpu: {}", have_intel_dgpu); | ||
|
||
let vrmonitor_path_string = alvr_server_io::steamvr_root_dir() | ||
.unwrap() | ||
.join("bin") | ||
.join("vrmonitor.sh") | ||
.into_os_string() | ||
.into_string() | ||
.unwrap(); | ||
debug!("vrmonitor_path: {}", vrmonitor_path_string); | ||
|
||
let mut vrmonitor_path_written = false; | ||
if have_igpu { | ||
if have_nvidia_dgpu { | ||
warn!("For functioning VR you need insert following into SteamVR and ALL (!) games commandline options:"); | ||
warn!( | ||
"For functioning VR you need to put following line into SteamVR commandline options and restart it:" | ||
); | ||
warn!("__GLX_VENDOR_LIBRARY_NAME=nvidia __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only \ | ||
VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json %command%") | ||
VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json {} %command%", vrmonitor_path_string); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm pretty sure There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could also extract the whole offload string into a separate variable if you're at it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hm... should we leave it like that? i forgot to change this, i mostly left it as is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or rather a long while ago |
||
warn!("And similar commandline to ALL games commandline option you're trying to launch from steam: \ | ||
__GLX_VENDOR_LIBRARY_NAME=nvidia __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json %command%"); | ||
vrmonitor_path_written = true; | ||
} else if have_intel_dgpu || have_amd_dgpu { | ||
warn!("For functioning VR you need insert following into SteamVR and ALL (!) games commandline options:"); | ||
warn!("DRI_PRIME=1 %command%") | ||
warn!( | ||
"For functioning VR you need to put following line into SteamVR commandline options and restart it:" | ||
); | ||
warn!("DRI_PRIME=1 {} %command%", vrmonitor_path_string); | ||
warn!("And similar commandline to ALL games commandline options you're trying to launch from stean:"); | ||
warn!("DRI_PRIME=1 %command%"); | ||
vrmonitor_path_written = true; | ||
} else { | ||
warn!("Beware, using just integrated graphics might lead to very poor performance in SteamVR and VR games."); | ||
warn!("For more information, please refer to the wiki: https://github.com/alvr-org/ALVR/wiki/Linux-Troubleshooting") | ||
} | ||
} | ||
if !vrmonitor_path_written { | ||
warn!( | ||
"Make sure you have set following line in your SteamVR commandline options and restart it: {} %command%", | ||
vrmonitor_path_string | ||
) | ||
} | ||
} | ||
fn linux_encoder_checks(device_infos: &[DeviceInfo]) { | ||
|
||
fn linux_encoder_checks(device_infos: &[(&wgpu::Adapter, DeviceInfo)]) { | ||
for device_info in device_infos { | ||
match device_info { | ||
match device_info.1 { | ||
DeviceInfo::Nvidia => { | ||
match nvml_wrapper::Nvml::init() { | ||
Ok(nvml) => { | ||
|
@@ -191,7 +256,9 @@ fn linux_encoder_checks(device_infos: &[DeviceInfo]) { | |
"Couldn't find VA-API runtime on system, \ | ||
you unlikely to have hardware encoding. \ | ||
Please install VA-API runtime for your distribution \ | ||
and make sure it works (Manjaro, Fedora).", | ||
and make sure it works (Manjaro, Fedora affected). \ | ||
For detailed advice, check wiki: \ | ||
https://github.com/alvr-org/ALVR/wiki/Linux-Troubleshooting#failed-to-create-vaapi-encoder", | ||
); | ||
} | ||
} | ||
|
@@ -231,31 +298,28 @@ fn probe_libva_encoder_profile( | |
let profile_probe = libva_display.query_config_entrypoints(profile_type); | ||
let mut message = String::new(); | ||
if profile_probe.is_err() { | ||
message = format!( | ||
"Couldn't find {} profile. You unlikely to have hardware encoding for it.", | ||
profile_name | ||
); | ||
message = format!("Couldn't find {} encoder.", profile_name); | ||
} else if let Ok(profile) = profile_probe { | ||
if profile.is_empty() { | ||
message = format!( | ||
"{} profile entrypoint is empty. \ | ||
You unlikely to have hardware encoding for it.", | ||
profile_name | ||
); | ||
message = format!("{} profile entrypoint is empty.", profile_name); | ||
} | ||
if !profile.contains(&libva::VAEntrypoint::VAEntrypointEncSlice) { | ||
message = format!( | ||
"{} profile does not contain encoding entrypoint. \ | ||
You unlikely to have hardware encoding for it.", | ||
"{} profile does not contain encoding entrypoint.", | ||
profile_name | ||
); | ||
} | ||
} | ||
if !message.is_empty() { | ||
if is_critical { | ||
error!("{}", message); | ||
error!("{} Your gpu may not suport encoding with this.", message); | ||
} else { | ||
info!("{}", message); | ||
info!( | ||
"{} | ||
Your gpu may not suport encoding with this. \ | ||
If you're not using this encoder, ignore this message.", | ||
message | ||
); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we specify the full command everywhere then I think we have to include some section about merging them in case multiple things apply to a user. Tho I'm not sure if providing the full thing doesn't actually make it harder than providing a short guide on how to concatonate things with examples.
Also why are people too stupid to concatonate simple strings???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
less things to to do for user - the better imo
alvr uses wide variety of users, from someone who has no idea what software is, to someone who writes code - and even they can be confused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
giving them full guide how to concatenate multiple strings in specific way just because something has to be aligned like that is a way to make newbie user frustrated already
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I just want to ensure that we don't cause more issues in case someone needs to apply more than one fix at a time. Because if you just tell them to "paste this" every time they'll either overwrite the other things or end up with multiple
%command%
s at once.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I accidentally put this on the wrong file, oops, what I said should go for the wiki, not for the checking in code