Ptx is not embedded in the binary

I am trying to get ptx code from my binary. The command to compile my binary is follow

nvcc -lcurand -gencode arch=compute_75,code=\"sm_75,compute_75\" --std=c++11 -I. -O3 -dc main.cu -o main.o --cudart shared
nvcc -gencode arch=compute_75,code=\"sm_75,compute_75\" -lcurand main.o -o main --cudart shared

When I do cuobjdump main -all, the output is

Fatbin elf code:
================
arch = sm_75
code version = [1,7]
producer = <unknown>
host = linux
compile_size = 64bit

Fatbin elf code:
================
arch = sm_75
code version = [1,7]
producer = <unknown>
host = linux
compile_size = 64bit
compressed

Fatbin ptx code:
================
arch = sm_75
code version = [7,3]
producer = <unknown>
host = linux
compile_size = 64bit
compressed
ptxasOptions = --compile-only

However, if I do cuobjdump main -ptx, it does not output any ptx code except the meta information

Fatbin elf code:
================
arch = sm_75
code version = [1,7]
producer = <unknown>
host = linux
compile_size = 64bit

I wonder what went wrong here? I think my compilation flag code=\"sm_75,compute_75\" can embed ptx.

How about ‘cuobjdump -ptx main’?

1 Like