Skip to content

Commit

Permalink
fix: fix gpu detect on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
stringhandler committed Sep 24, 2024
1 parent 80e5d54 commit 30f690c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
13 changes: 11 additions & 2 deletions src-tauri/src/gpu_miner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,19 @@ impl GpuMiner {
}
}

pub async fn detect(&mut self) -> Result<(), anyhow::Error> {
pub async fn detect(&mut self, config_dir: PathBuf) -> Result<(), anyhow::Error> {
info!(target: LOG_TARGET, "Verify if gpu miner can work on the system");

let args: Vec<String> = vec!["--detect".to_string(), "true".to_string()];
let args: Vec<String> = vec![
"--detect".to_string(),
"true".to_string(),
"--config".to_string(),
config_dir
.join("gpuminer")
.join("config.json")
.to_string_lossy()
.to_string(),
];
let gpuminer_bin = BinaryResolver::current()
.resolve_path(Binaries::GpuMiner)
.await?;
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ async fn setup_inner(
.gpu_miner
.write()
.await
.detect()
.detect(config_dir.clone())
.await
.inspect_err(|e| error!(target: LOG_TARGET, "Could not detect gpu miner: {:?}", e));

Expand Down
1 change: 0 additions & 1 deletion src-tauri/src/xtrgpuminer_manager.rs

This file was deleted.

0 comments on commit 30f690c

Please sign in to comment.