How superm1/rocr-runtime works
• The HSA Runtime (the “ROCr” part) that provides a thin, user-mode API for AMD GPU programming, implementing features such as runtime initialization, agent information, memory management, and more.
• The ROCt Thunk Library (located as libhsakmt) which acts as the “thunk” layer interfacing directly with the kernel driver (ROCk).
Main Components & Layers
a. User Applications: Represent client applications that link against the HSA runtime (using the provided CMake packages).
b. HSA Runtime Library (ROCr): This is the core runtime layer that offers the GPU API for error handling, initialization/shutdown, memory management, low-level queue management, and dispatch via the HSA Architected Queuing Language.
c. ROCt Thunk Library (libhsakmt): This library provides the interface between the user-mode runtime and the underlying ROCm kernel driver (ROCk). It encapsulates system-level calls and direct hardware interactions.
d. Kernel Driver (ROCk): Although not built within this repository, denote it as the hardware or kernel-level interface required for complete GPU interaction.
e. Test Suites & Validation:
• rocrtst: The runtime test suites for validating and performance testing the HSA implementation.
• kfdtest: The specific set of tests that validate the ROCt interface.
f. Build & Packaging Infrastructure: Optionally, include components such as CMake build scripts, packaging directories (RPM, DEBIAN), and CI configurations which orchestrate the integration and release pipelines.
Relationships & Interactions
• An internal link between the HSA Runtime and the ROCt Thunk Library (libhsakmt) since the runtime statically links with ROCt.
Architectural Patterns & Design Principles
• Modularity by separating the runtime API (user-facing) from the hardware-specific thunk (driver interfacing).
• Layered approach where the HSA Runtime abstracts low-level hardware details, ensuring a clean separation between application logic and kernel-level operations.
Technologies and Frameworks
• CMake (as seen in the root CMakeLists.txt and cmake_modules directories) coordinating the build.
• The CI/CD configurations (.github and .azuredevops folders) that help automate integration and testing.
• Linux-specific development targeting ROCm systems, as noted by dependencies and build instructions.