"errstr" undefined in cuda component

Issue #87 resolved
Gerald Ragghianti created an issue

As of commit https://bitbucket.org/icl/papi/commits/7fd8920d905b9f1749defdea120d8a1df757528a

Compile of cuda component with cuda 11.x results in undeclared “errstr”:

In file included from ./papi_internal.h:24,
                 from components/cuda/linux-cuda.c:59:
components/cuda/linux-cuda.c: In function 'cuda11_getMetricsContextPtr':
components/cuda/linux-cuda.c:391:73: error: 'errstr' undeclared (first use in this function); did you mean 'strstr'?
  391 |             SUBDBG("error: function %s failed with error %s.\n", #call, errstr);                    \
      |                                                                         ^~~~~~
./papi_debug.h:60:126: note: in definition of macro 'PAPIDEBUG'
   60 | e PAPIDEBUG(level,format, args...) { if(_papi_hwi_debug&level){DEBUGLABEL(DEBUGLEVEL(level));fprintf(stderr,format, ## args);}}
      |                                                                                                                        ^~~~

components/cuda/linux-cuda.c:391:13: note: in expansion of macro 'SUBDBG'
  391 |             SUBDBG("error: function %s failed with error %s.\n", #call, errstr);                    \
      |             ^~~~~~

See build log https://xylitol.icl.utk.edu/job/PAPI/job/Components/component=cuda,label=gpu_nvidia/584/console

Comments (9)

  1. Gerald Ragghianti reporter

    Yes it does now compiler, but I’m receiving an error from the cuda component. Can you check it when running papi_component_avail:

    Compiled-in components:
    Name:   perf_event              Linux perf_event CPU counters
    Name:   perf_event_uncore       Linux perf_event CPU uncore and northbridge
    Name:   cuda                    CUDA events and metrics via NVIDIA CuPTI interfaces
       \-> Disabled: CUDA init failed. Code failed to record a reason.
    

  2. Giuseppe Congiu

    The failure seems to be caused by cuDevicePrimaryCtxRetain in line 4398 of linux-cuda.c, when the component adds cuda11 native events. I have no idea what that code does exactly. However, this seems to be a separate problem from what was tracked initially by this issue. I will have a better look at the code, but it will take a while.

  3. Giuseppe Congiu

    Yes, thank you. It would be better so I can reference the issue in the commit message of the fix and close it automatically.

  4. Log in to comment