Segment 2
In this sub-session, I diagnosed why PoRep partitioned proofs were failing on the remote test host (10.1.16.218) with 2 GPUs, while working correctly on the local single-GPU machine. After ruling out PCE changes as the cause, I identified the root cause: the CUDA_VISIBLE_DEVICES environment variable approach for GPU selection is broken because the C++ code reads it at static initialization time, so Rust's set_var has no effect. Consequently, all workers target GPU 0 regardless of their assigned GPU index, but the Rust engine uses separate mutexes per GPU, allowing concurrent kernel execution and causing data races. The fix is to use a single shared mutex for all workers when num_circuits=1 (partitioned proof case), ensuring serialized GPU access. I applied the edit to engine.rs, which needs to be built, deployed, and tested.
The Phantom GPU: Debugging a Race Condition That Only Exists on Two GPUs