cuda_parsers

Crates.iocuda_parsers
lib.rscuda_parsers
version0.1.0
sourcesrc
created_at2023-12-29 05:32:36.819216
updated_at2023-12-29 05:32:36.819216
descriptionParsers for CUDA binary files.
homepage
repositoryhttps://github.com/VivekPanyam/cudaparsers
max_upload_size
id1082982
size36,870
Vivek Panyam (VivekPanyam)

documentation

README

This repo contains parsers for CUDA binary files. These file formats are not publicly documented so correctly parsing them can be tricky.

What are CUDA binaries?

These are the GPU executable files generated from compiling CUDA code. They are often embedded within other applications. Among other things, they contain the instructions that are actually executed on GPU.

You may have interacted with these files if you've used any of the cuModuleLoad* functions in the CUDA driver API.

There are two types of CUDA binaries:

  • cubin files: These run on one particular GPU architecture. This is because each architecture can have different instruction sets and capabilities
  • fatbin files: These are fat binaries that contain cubin files for several architectures

This repo has well tested support for parsing cubin files and basic support for parsing fatbin files. See below for more details

The parsers are implemented in Rust, but can be exposed to other languages if there's interest (feel free to create an issue!).

Why?

cubin files contain a lot of useful information that's not exposed by CUDA APIs.

The parsers in this repo were initially built for an internal project that needed detailed information about CUDA modules and kernels.

How can you confidently parse an undocumented format?

This post contains a detailed answer: https://blog.vivekpanyam.com/parsing-an-undocumented-file-format

Short version: we test on thousands of cubin files to ensure that the output produced by this parser matches the output of cuobjdump from NVIDIA.

Commit count: 9

cargo fmt