This commit is contained in:
Michael Vines
2021-04-18 10:27:36 -07:00
parent 3b79b21e9d
commit a911ae00ba
39 changed files with 113 additions and 144 deletions

View File

@ -117,25 +117,23 @@ fn find_cuda_home(perf_libs_path: &Path) -> Option<PathBuf> {
}
// Search /usr/local for a `cuda-` directory that matches a perf-libs subdirectory
for entry in fs::read_dir(&perf_libs_path).unwrap() {
if let Ok(entry) = entry {
let path = entry.path();
if !path.is_dir() {
continue;
}
let dir_name = path.file_name().unwrap().to_str().unwrap_or("");
if !dir_name.starts_with("cuda-") {
continue;
}
let cuda_home: PathBuf = ["/", "usr", "local", dir_name].iter().collect();
if !cuda_home.is_dir() {
continue;
}
info!("CUDA installation found at {:?}", cuda_home);
return Some(cuda_home);
for entry in fs::read_dir(&perf_libs_path).unwrap().flatten() {
let path = entry.path();
if !path.is_dir() {
continue;
}
let dir_name = path.file_name().unwrap().to_str().unwrap_or("");
if !dir_name.starts_with("cuda-") {
continue;
}
let cuda_home: PathBuf = ["/", "usr", "local", dir_name].iter().collect();
if !cuda_home.is_dir() {
continue;
}
info!("CUDA installation found at {:?}", cuda_home);
return Some(cuda_home);
}
None
}