Retrieve what compute capabilities (sm versions) that a compiled libtorch version supports?

Hi,
I’m wondering how I’d be able to retrieve a list of supported compute capabilities of a certain compiled version of libtorch? I basically need to investigate the fat binary produced, to see that it contains the correct support for different compute capabilities/GPUs (including the PTX version for future compatibility). How can I do this? The version of libtorch has not been compiled with python support, it’s only compiled for the static C++ libtorch linking, so it needs to work from C++ please. Or if I can investigate the static library “libtorch.a” or “libtorch_cuda.a” in some way?

Cheers,
David

I’ll answer my own question here because I found the answer. You can use the binary cuobjdump from the CUDA Toolkit, documented here: CUDA Binary Utilities

So it’s as easy as running the following commands in a command line:
cuobjdump --list-elf name_of_library.a
cuobjdump --list-ptx name_of_library.a

Cheers,
David