NVlabs / NVBit

200 stars 18 forks source link

Can't instrument relocatable device code #16

Closed AKKamath closed 4 years ago

AKKamath commented 4 years ago

I have a program written in main.cu with a kernel that is executed calling some device functions declared in header.cuh. In header.cu, I've given the definitions.

When I compile this using -rdc flag, and try instrumenting the code, none of the instrumented device code gets executed.

When I use verbose mode during the instrumentation process, the instructions inside header.cu show up, meaning NVBit is aware that they exist. However, the instrumented device function never gets executed if the code is inside header.cu.

ovilla commented 4 years ago

We never seen anything like that, but we did not test specifically for it. Could you please attach your simplified example application so we can try reproduce on our side? Meaning a simplified version of these files:

Makefile main.cu header.cuh header.cu

Thanks!

AKKamath commented 4 years ago

Thanks for the quick response!

NVBit_Example.zip

I've attached the files. You can try running the mem_trace tool on it.

My observation is the code within the device function doesn't get instrumented, but if I replace the function call with the code inside the function it gets instrumented properly. Moving the device function to the main.cu file also allows it to get instrumented.

ovilla commented 4 years ago

You are right, I see the same issue. I am surprised we never discovered this before. Thanks a lot for reporting this, we will look into it as soon as possible.

I can't estimate how long it will take to solve it, but for sure it is something we have to address or at least document.

AKKamath commented 4 years ago

Alright. Thanks again for the response.

x-y-z commented 4 years ago

It is fixed in NVBit 1.4.