How to access cuda kernel binary in GPU?

confidential computing seems to be a technology that could be relevant.

CC mode is only available in Hopper. We want to protect PCIe for legacy GPU without CC support.

It seems to me, because I ran a simple test, that you cannot get a pointer to code space on the CUDA GPU and do ordinary read or write on the data in any way.

I succeed to read/write kernel code by:

  1. use nvbit’s API nvbit_get_func_addr to locate the function
  2. read/write the code inside another kernel.

Hope that can help you, though there may be some tricks in NVBit. Your test is interesting, I’ll also have a try.