NVlabs / NVBit

198 stars 18 forks source link

If more than one registers' values are passed into inject functions, they are inconsistent #81

Closed xinyi-li7 closed 2 years ago

xinyi-li7 commented 2 years ago

When I'm operating an FP64 instruction, I need to read the value in the destination register. Since they are 32-bit registers, I need to pass reg_num and reg_num+1 into the inject function. However, I noticed something wrong in the second register, so I did a naive test.

  1. I passed the values from the same register's number into the inject function through nvbit_add_call_arg_reg_val. image
  2. In the inject function, I checked if these two values are equal image
  3. It seems that all of them print false.
  4. If I pass the registers' number with nvbit_add_call_arg_const_val32, and read them through nvbit_read_reg in inject function, it will print true or false alternatively.

Thus, my questions are:

  1. From my understanding, val_low should be equal to val_hi since they are from the same register; however, in my test, they are different.
  2. I suppose the two read-registers approaches should have the same result, but from my test, it seems they are different.

Do you know what's the problems here? I would very much appreciate it if you could help me figure out this issue!

x-y-z commented 2 years ago

Do you have a simplified version of your code? I am not able to reproduce either of the issues locally.

I am running on r465 and CUDA 11.3.

xinyi-li7 commented 2 years ago

Hi Zi Yan, I just found it's my programming error when creating the simple version. Sorry for bothering you.