I am attempting to debug a Rust project using cuda-gdb
, where the project call CUDA functions through FFI. I am unsure whether such programs are supported by cuda-gdb
. However, there are no reported errors from cuda-gdb
, and setting breakpoints works correctly; breakpoints on the CPU side are hit as expected, but breakpoints on the GPU side result in the program hanging indefinitely.
The rust project: sppark
OS: Ubuntu 20.04.6 LTS
CUDA toolkit:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Fri_Sep__8_19:17:24_PDT_2023
Cuda compilation tools, release 12.3, V12.3.52
Build cuda_12.3.r12.3/compiler.33281558_0
Driver version: 545.23.06
Graphics card: GTX3080
Rustc version: rustc 1.75.0-nightly (97c81e1b5 2023-10-07)
Reproduction steps for the issue:
- Modify the
poc/msm-cuda/build.rs
file
Replace the code on lines 102 and 103:
nvcc.flag("-arch=sm_80");
nvcc.flag("-gencode").flag("arch=compute_70,code=sm_70");
with the following code:
nvcc.flag("-arch=compute_86");
nvcc.flag("-code=sm_86");
nvcc.flag("-G");
nvcc.flag("-g");
- cd poc/msm-cuda
- cargo test --features bls12_377 --no-run
This will create an executable file with a name starting with ‘msm-’ in the ‘target/debug/deps’ directory. - cuda-gdb target/debug/deps/msm-XXXXXX
- set args --test msm_correctness
- b breakdown
Output of cuda-gdb: