fix: show empty dropdown menu when no app uses dGPU
This commit is contained in:
parent
941cbf546b
commit
3670f124fb
1 changed files with 5 additions and 1 deletions
|
|
@ -222,7 +222,11 @@ impl Gpu {
|
|||
Some(
|
||||
smi_output
|
||||
.lines()
|
||||
.filter(|line| !line.starts_with('#'))
|
||||
.filter(|line| {
|
||||
// smi shows an empty line filled with - when no app is running
|
||||
let components = line.split_whitespace().collect::<Vec<_>>();
|
||||
components[1].trim().ne("-") && !line.starts_with('#')
|
||||
})
|
||||
.map(|line| {
|
||||
let components = line.split_whitespace().collect::<Vec<_>>();
|
||||
let pid = components[1].trim();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue