|
FZGPUModules 2.0
GPU-accelerated modular compression pipelines
|
This page covers everything needed to build FZGPUModules: getting the source, configuring with CMake, running tests, installing, and integrating into your own project.
| Requirement | Minimum |
|---|---|
| CUDA Toolkit | 11.2+ (stream-ordered allocator) |
| C++ Standard | C++17 |
| CMake | 3.24+ |
| Compiler | GCC 9+ or Clang 10+ |
| Host byte order | Little-endian |
The googletest testing framework is a git submodule under third_party/googletest. The tomlplusplus library (used for config file parsing) is vendored in third_party/tomlplusplus and requires no extra steps.
The fastest path to a working build uses the release preset:
This builds the library (libfzgmod.so) and the fzgmod-cli command-line tool. Each preset gets its own build directory under build/<preset>/, so presets coexist.
To build with tests:
| Preset | Build type | Purpose |
|---|---|---|
release | Release | Normal development and testing |
debug | Debug | Unoptimized build with -Wall |
asan | Debug | AddressSanitizer + UndefinedBehaviorSanitizer |
compute-san | RelWithDebInfo | CUDA Compute Sanitizer (auto-wraps ctest with memcheck) |
Configure and build any preset:
| Option | Default | Description |
|---|---|---|
CMAKE_BUILD_TYPE | Release | Build type: Release or Debug |
BUILD_SHARED_LIBS | ON | Build as a shared library; set OFF for static |
BUILD_TESTING | OFF | Build the test suite |
BUILD_EXAMPLES | OFF | Build example executables |
BUILD_PROFILING | OFF | Build profiling targets (requires Nsight Systems / NVTX3) |
BUILD_CLI | ON | Build the fzgmod-cli command-line tool |
USE_SANITIZER | — | Sanitizer mode: ASanUbsan, TSan, or Compute |
COMPUTE_SANITIZER_DEVICE_DEBUG | OFF | Add -G to CUDA builds for source-level Compute Sanitizer (much slower) |
CMAKE_CUDA_ARCHITECTURES | — | CUDA compute capability (e.g., 75, 80, 90); comma-separated for multiple |
CMAKE_INSTALL_PREFIX | /usr/local | Installation prefix for cmake --install |
Development build (with tests, profiling, examples, and sanitizer support):
Replace 80 with your GPU's compute capability (e.g., 75 for V100, 80 for A100, 90 for H100). See NVIDIA CUDA Compute Capability for your GPU.
Release build (optimized, with examples):
| Target | Location |
|---|---|
Library (libfzgmod.so / .a) | build/release/ |
CLI (fzgmod-cli) | build/release/bin/ |
| Examples | build/release/bin/examples/ |
| Tests | build/release/tests/ |
| Profiling | build/release/bin/profiling/ |
Build tests with -DBUILD_TESTING=ON:
Then run the full suite with ctest:
Or directly against the build tree:
Two flags are required when running with CUDA:
protect_shadow_gap=0 — ASan maps a large shadow-memory region that overlaps the VA range CUDA uses for its pool allocator. Without this flag cudaMemPoolCreate fails with out of memory on every test.detect_leaks=0 — CUDA driver internals allocate persistent host memory that is never freed; suppressing this avoids false positives from libcuda.so.The compute-san preset wraps every ctest run with compute-sanitizer --tool memcheck automatically:
For other tools (initcheck, racecheck, synccheck), run test binaries directly:
Note: tests run 10–100× slower under Compute Sanitizer. Use --gtest_filter to target specific tests when iterating on a fix.
Do not combine TSan with ASan in the same build.
This installs headers, the library, and CMake package config files under the prefix.
After installation (or by pointing CMAKE_PREFIX_PATH at the build tree):
Build the Doxygen HTML documentation (requires Doxygen 1.9.8+ and Graphviz dot):
Output is written to docs/doxygen/html/. Open index.html in a browser.