Question:
Is there any way to view the data in the array slots of rmm::device_vector via cuda-gdb?
Background
Running the ./JOIN_TEST for example in cuda-gdb.
If I set a breakpoint at hash_join.cu:299, I'd like to inspect the contents in left_indices or right_indices.
Is that possible via cuda-gdb?
I can see the size of the vector is 5, and I've tried the below but it doesn't appears to not show what I'd expect. I know there is at least one slot populated as I can see it's being added via add_pair_to_cache.
(cuda-gdb) p *(int *)right_indices.begin()@5
$6 = {-742385152, 32764, -1856855040, 626661425, -140435456}
You need to indicate to cuda-gdb that this is global device memory with the @global specifier. Like this:
(cuda-gdb) p ((@global int *)right_indices.begin())[0]@5
Note I also needed to add the [0] to access the starting index of the array. Otherwise I got errors.
Here's an example I just tried locally. This is on a device_buffer and char data initialized to an incrementing sequence, but should work the same for device_vector.
(cuda-gdb) print buff
$3 = {_data = 0x7f58f3c00200, _size = 1000, _capacity = 1000, _stream = 0x0, _mr = 0x55b2d83cdb20}
(cuda-gdb) print buff._data
$4 = (void *) 0x7f58f3c00200
(cuda-gdb) print ((@global char*)buff._data)[0]
$5 = 0 '\000'
(cuda-gdb) print ((@global char*)buff._data)[1]
$6 = 1 '\001'
(cuda-gdb) print ((@global char*)buff._data)[0]@5
$7 = "\000\001\002\003\004"
(cuda-gdb) print ((@global char*)buff._data)[0]@100
$8 = "\000\001\002\003\004\005\006\a\b\t\n\v\f\r\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037 !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abc"
I'm impressed that you even got a debug build of libcudf to succeed currently.
Here's the cuda-gdb docs for this feature: https://docs.nvidia.com/cuda/cuda-gdb/index.html#memory-and-variables
Closing. Please reopen if you still have trouble.
Really appreciate the reply, thank you.
For anybody else viewing the issue in the future, I managed to get cudf to build in debug locally with 64GB of ram + ninja (cmake failed for all sorts of reasons). ninja will consistently fail on the first build but succeed on the second try.