What is the difference between the two functions readSyscallCallDepth() and readCallDepth ()

Hi,
There are two functions
CUDBGResult ( CUDBGAPI_st::readCallDepth )( uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint32_t depth )
and
CUDBGResult ( CUDBGAPI_st::readSyscallCallDepth )( uint32_t dev, uint32_t sm, uint32_t wp, uint32_t ln, uint32_t depth )
in debugger api document.
What is the difference between these two functions, what does syscall mean?

Hi @204540478
Short version:

  • readCallDepth returns number of GPU call frames above the current frame
  • readSyscallCallDepth returns the number of syscal frames

Longer version:

Consider the following example:

  1 #include <assert.h>
  2 
  3 __device__ void foo()
  4 {
  5 assert (0);
  6 }
  7 
  8 __device__ void bar()
  9 {
 10 foo();
 11 }
 12 
 13 __global__ void entry()
 14 {
 15 bar();
 16 }
 17 
 18 int main()
 19 {
 20 entry<<<1,1>>>();
 21 cudaDeviceSynchronize();
 22 }

When assert is hit the backtrace would be the following:

#0  0x00007fffd8e24310 in ?? ()
#1  0x00007fffd926e630 in __assert_fail ()
#2  0x00007fffd926da00 in foo () at test.cu:5
#3  0x00007fffd926cda0 in bar () at test.cu:10
#4  0x00007fffd926c340 in entry<<<(1,1,1),(1,1,1)>>> () at test.cu:15

The first frame (#0 0x00007fffd8e24310 in ?? ()) is a syscall frame, so:

  • readSyscallDepth would return 1 (one syscall frame)
  • readCallDepth would return 4 (4 frames above the current one)

I totally get it. Thank you very much for your careful explanation.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.