How to use cuobjdump on Mojo kernels?

Hi!

I’m trying to understand how to use cubodjump on Mojo kernels. I built an executable called gemm that launches a kernel and I would like to get the ptx/sass to poke around a bit.

However, when I try to run cuobjdump on it, I get cuobjdump info : File '/workspace/gpu-intro/gemm' does not contain device code

If I ldd the executable, it doesn’t seem like it obviously links the kernel in from any other shared object? In general, what is the recommended way to look at the generated assembly?

Thanks!

If it’s PTX you want, you can get that directly at function compilation. For your kernel function, use something like the following to capture the PTX to a file:

fn vector_addition():
    ....

alias out_file = Path("/tmp/my_file.ptx")
_ = ctx.compile_function[vector_addition, dump_asm=out_file]()

You can also add a parameter to the above like target=_get_gpu_target["sm_90"]() to generate PTX for a specific architecture.

1 Like