Skip to content

[REQ] Add wp.print_diagnostics() for build & runtime diagnostics #1221

Description

@shi-eric

Description

Add a wp.print_diagnostics() function (similar to jax.print_environment_info()) that prints a comprehensive snapshot of the Warp build and runtime environment — useful for debugging, bug reports, and CI logs.

The function prints human-readable output and returns a dict for programmatic access.

Information displayed

Software versions:

  • Warp version (Python package, native library, warp-clang library)
  • LLVM version (statically compiled into warp-clang — currently not exposed to Python)
  • Python version, NumPy version, OS/platform
  • Git commit hash (if set by CI)

CUDA & library info:

  • CUDA Toolkit version, CUDA Driver version, NVRTC version
  • CUDA compatibility mode, MathDx enabled/disabled
  • libmathdx version (currently not exposed to Python)
  • NanoVDB version (currently not exposed to Python)
  • Host C++ compiler used to build native library (currently not exposed to Python)

Build flags:

  • Debug mode (WP_ENABLE_DEBUG — function exists in native code but no Python binding)
  • Verify FP (WP_VERIFY_FP — build-time define, no query function)
  • Fast math (compiler flag only, no preprocessor define or query function)

Devices:

  • Device list with alias, name, memory, architecture, mempool status

Example output

warp:              1.12.0.dev0
warp native:       1.12.0.dev0
warp-clang:        1.12.0.dev0 (LLVM 22.0.0)
numpy:             2.4.1
python:            3.12.3 (main, Jan 22 2026, 20:57:42) [GCC 13.3.0]
platform:          Linux-6.8.0-94-generic-x86_64

CUDA enabled:      True
CUDA Toolkit:      13.1
CUDA Driver:       13.1
NVRTC:             13.1
CUDA compat:       False
MathDx enabled:    True
libmathdx:         0.3.0
NanoVDB:           32.8.0
Host compiler:     GCC 13.3.0

Build flags:
  Debug:           False
  Verify FP:       False
  Fast math:       False

Devices:
  "cpu"       "CPU"
  "cuda:0"    "NVIDIA RTX PRO 6000 ..." (97 GiB, sm_100, mempool enabled)

Context

Currently there is no single function to dump all build and environment information. Users must piece together wp.__version__, wp.get_cuda_toolkit_version(), etc. Several pieces of build info — LLVM version, NanoVDB version, libmathdx version, host compiler version, and build flags (debug, verify_fp, fast_math) — are not exposed to Python at all, requiring new native C/C++ query functions and ctypes bindings.

This feature is modeled after jax.print_environment_info() and would be valuable for:

  • Bug reports: Users can paste the output for complete environment context
  • CI diagnostics: Quick verification of build configuration
  • Debugging: Identifying mismatched versions or unexpected build flags

Implementation scope

  • Native C/C++ changes: ~6 new WP_API functions across warp.h, warp.cpp, warp.cu, volume.cpp, clang.cpp
  • Build system: Add WP_FAST_MATH preprocessor define to build_dll.py
  • Python bindings: ctypes registrations, Runtime methods, module-level functions in context.py
  • Public API: wp.print_diagnostics() + individual getters exported via __init__.py
  • Tests: New test file for the function and individual getters

Activity

  1. changed the title [-][REQ] Add wp.print_environment_info() for build & runtime diagnostics[/-] [+][REQ] Add wp.print_diagnostics() for build & runtime diagnostics[/+] on Feb 8, 2026
  2. self-assigned this
    on Feb 8, 2026
  3. added this to the 1.12.0 milestone on Feb 8, 2026
  4. shi-eric commented on Feb 13, 2026

    @shi-eric
    ContributorAuthor

    Added in 1151675

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

feature requestRequest for something to be added

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions