Skip to content

Commit

Permalink
fix(cuda-prover): dont discard stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
lispc committed Sep 18, 2024
1 parent 7457d8b commit 23c9acf
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions crates/cuda/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,22 @@ impl SP1CudaProver {
.spawn()
.expect("failed to start Docker container");

let stderr = child.stderr.take().unwrap();
std::thread::spawn(move || {
let mut reader = BufReader::new(stderr);
let mut buffer = [0; 1024];
loop {
match reader.read(&mut buffer) {
Ok(0) => break,
Ok(n) => {
std::io::stderr().write_all(&buffer[..n]).unwrap();
std::io::stderr().flush().unwrap();
}
Err(_) => break,
}
}
});

let stdout = child.stdout.take().unwrap();
std::thread::spawn(move || {
let mut reader = BufReader::new(stdout);
Expand Down

0 comments on commit 23c9acf

Please sign in to comment.