Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions crates/engine-cpu/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ pub enum EngineStatus {
Cancelled {
hash_count: u64,
},
/// GPU device lost or unresponsive. Worker should exit permanently.
DeviceLost {
hash_count: u64,
},
}

/// Cancellation checker passed to search_range.
Expand Down
12 changes: 6 additions & 6 deletions crates/engine-gpu/benches/gpu_engine_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::sync::atomic::AtomicBool;

fn bench_cpu_vs_gpu_small(c: &mut Criterion) {
let cpu_engine = FastCpuEngine::new(10_000);
let gpu_engine = GpuEngine::try_new(10_000_000, 0).expect("Failed to init GPU");
let gpu_engine = GpuEngine::try_new(10_000_000, 0, false).expect("Failed to init GPU");
let cancel_flag = AtomicBool::new(false);
let cancel_check = AtomicBoolCancelCheck(&cancel_flag);

Expand Down Expand Up @@ -59,7 +59,7 @@ fn bench_cpu_vs_gpu_small(c: &mut Criterion) {

fn bench_cpu_vs_gpu_medium(c: &mut Criterion) {
let cpu_engine = FastCpuEngine::new(10_000);
let gpu_engine = GpuEngine::try_new(10_000_000, 0).expect("Failed to init GPU");
let gpu_engine = GpuEngine::try_new(10_000_000, 0, false).expect("Failed to init GPU");
let cancel_flag = AtomicBool::new(false);
let cancel_check = AtomicBoolCancelCheck(&cancel_flag);

Expand Down Expand Up @@ -110,7 +110,7 @@ fn bench_cpu_vs_gpu_medium(c: &mut Criterion) {

fn bench_cpu_vs_gpu_large(c: &mut Criterion) {
let cpu_engine = FastCpuEngine::new(10_000);
let gpu_engine = GpuEngine::try_new(10_000_000, 0).expect("Failed to init GPU");
let gpu_engine = GpuEngine::try_new(10_000_000, 0, false).expect("Failed to init GPU");
let cancel_flag = AtomicBool::new(false);
let cancel_check = AtomicBoolCancelCheck(&cancel_flag);

Expand Down Expand Up @@ -161,7 +161,7 @@ fn bench_cpu_vs_gpu_large(c: &mut Criterion) {

fn bench_solution_finding(c: &mut Criterion) {
let cpu_engine = FastCpuEngine::new(10_000);
let gpu_engine = GpuEngine::try_new(10_000_000, 0).expect("Failed to init GPU");
let gpu_engine = GpuEngine::try_new(10_000_000, 0, false).expect("Failed to init GPU");
let cancel_flag = AtomicBool::new(false);
let cancel_check = AtomicBoolCancelCheck(&cancel_flag);

Expand Down Expand Up @@ -212,7 +212,7 @@ fn bench_solution_finding(c: &mut Criterion) {

fn bench_throughput_per_second(c: &mut Criterion) {
let cpu_engine = FastCpuEngine::new(10_000);
let gpu_engine = GpuEngine::try_new(10_000_000, 0).expect("Failed to init GPU");
let gpu_engine = GpuEngine::try_new(10_000_000, 0, false).expect("Failed to init GPU");
let cancel_flag = AtomicBool::new(false);
let cancel_check = AtomicBoolCancelCheck(&cancel_flag);

Expand Down Expand Up @@ -262,7 +262,7 @@ fn bench_throughput_per_second(c: &mut Criterion) {
}

fn bench_gpu_batch_efficiency(c: &mut Criterion) {
let gpu_engine = GpuEngine::try_new(10_000_000, 0).expect("Failed to init GPU");
let gpu_engine = GpuEngine::try_new(10_000_000, 0, false).expect("Failed to init GPU");
let cancel_flag = AtomicBool::new(false);
let cancel_check = AtomicBoolCancelCheck(&cancel_flag);

Expand Down
5 changes: 4 additions & 1 deletion crates/engine-gpu/examples/verify_nonce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn main() {

// 3. Verify with GPU engine
log::info!("Initializing GPU engine...");
let gpu_engine = GpuEngine::try_new(10_000_000, 0).expect("Failed to init GPU");
let gpu_engine = GpuEngine::try_new(10_000_000, 0, false).expect("Failed to init GPU");

// Search a small range around the valid nonce
let gpu_range = Range {
Expand Down Expand Up @@ -56,6 +56,9 @@ fn main() {
EngineStatus::Cancelled { .. } => {
log::error!("FAILURE: GPU search cancelled!");
}
EngineStatus::DeviceLost { .. } => {
log::error!("FAILURE: GPU device lost!");
}
EngineStatus::Running { .. } => {
log::error!("FAILURE: GPU returned Running status!");
}
Expand Down
Loading
Loading