pyxis-roc / gpu-api-interposer

GPU API interposer generation tools plus libcuda (CUDA Device API) and libcudart (CUDA Runtime API) interposers. Also includes harmonv, for now.
2 stars 0 forks source link

gen_xlat_metadata.py warns on unrecognized param info attribute #6

Closed bavalpey closed 3 years ago

bavalpey commented 3 years ago

While using gen_xlat_metadata for most benchmark programs, the following warning message occurs (the numbers following attribute vary from program to program)


/localdisk/bvalpey/projects/ROCetta/gpu-api-interposer/harmonv/harmonv/nvfatbin.py:306: UserWarning: Unrecognized param info attribute  3404 32
  warnings.warn(f"Unrecognized param info attribute  {attr_fmt:x} {attr_size}")```
sree314 commented 3 years ago

Procedure to fix this. First observe the error to identify the cubin (this is new):

nvfatbin.py:308: UserWarning: batchedLabelMarkersAndCompressionNPP.3.sm_50.cubin: Unrecognized param info attribute  3404 400

Then use fbextract.py to obtain the cubin.

Run nvdisasm and look for 0x04, 0x34, this should give you:

        //----- nvinfo : EIATTR_INDIRECT_BRANCH_TARGETS
        .align          4
.L_1610:
        /*00b8*/        .byte   0x04, 0x34
        /*00ba*/        .short  (.L_1612 - .L_1611)

        //   ....[0]....
.L_1611:

So 0x3404 is EIATTR_INDIRECT_BRANCH_TARGETS, and is an array ([0]) of offsets which may have additional structure.

First, add EIATTR_INDIRECT_BRANCH_TARGETS = 0x3404 to nvinfo.py, and handle it in parse_nv_info_section. If you need to extract structured data, do that in parse_fn_info

Most attributes contain size of data that follows so += attr_size is appropriate. Some do not. The nvdisasm disassembly should help you recognize this.

See the commit that closes this issue for examples.