mirror of
https://github.com/ilya-zlobintsev/LACT.git
synced 2025-02-25 18:55:26 -06:00
fix: check for DEVTYPE=drm_minor when trying to find usable gpu paths instead of using the name
This commit is contained in:
parent
b461106edd
commit
0bc59a02cc
@ -8,7 +8,7 @@ use lact_schema::{
|
|||||||
};
|
};
|
||||||
use std::{
|
use std::{
|
||||||
collections::HashMap,
|
collections::HashMap,
|
||||||
env,
|
env, fs,
|
||||||
path::PathBuf,
|
path::PathBuf,
|
||||||
sync::{Arc, RwLock},
|
sync::{Arc, RwLock},
|
||||||
};
|
};
|
||||||
@ -35,11 +35,8 @@ impl<'a> Handler {
|
|||||||
{
|
{
|
||||||
let entry = entry?;
|
let entry = entry?;
|
||||||
|
|
||||||
let name = entry
|
if let Ok(drm_uevent) = fs::read_to_string(entry.path().join("uevent")) {
|
||||||
.file_name()
|
if drm_uevent.contains("DEVTYPE=drm_minor") {
|
||||||
.into_string()
|
|
||||||
.map_err(|_| anyhow!("non-utf path"))?;
|
|
||||||
if name.starts_with("card") && !name.contains('-') {
|
|
||||||
trace!("trying gpu controller at {:?}", entry.path());
|
trace!("trying gpu controller at {:?}", entry.path());
|
||||||
let device_path = entry.path().join("device");
|
let device_path = entry.path().join("device");
|
||||||
match GpuController::new_from_path(device_path) {
|
match GpuController::new_from_path(device_path) {
|
||||||
@ -60,6 +57,7 @@ impl<'a> Handler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let handler = Self {
|
let handler = Self {
|
||||||
gpu_controllers: Arc::new(controllers),
|
gpu_controllers: Arc::new(controllers),
|
||||||
|
Loading…
Reference in New Issue
Block a user