← Back to Pull requests

feat(build): emit Comgr PDB for Windows driver builds #8153

Merged
YashDeshpande25 merged 4 files (38 lines) on Oct 05, 2026 21:38 UTC
View on GitHub
YashDeshpande25 YashDeshpande25 commented on Sep 11, 2026 05:14 UTC
Author

Motivation

Windows driver packages ship Comgr without symbols, so Microsoft's WHQL crash telemetry cannot attribute failures to a function — every crash collapses into a single amd_comgr_3.dll!Unknown bucket. With symbols indexed at Microsoft, those
become per-function buckets that can be triaged as individual bugs.

The PDB is not shipped to end users. It goes only into the WHQL signing package submitted to the Microsoft Hardware Dev Center.

_Work Item: SWDEV-593634_

Related: #6034

Technical Details

Scoped entirely to THEROCK_FLAG_WINDOWS_DRIVER_BUILD; no effect on any other configuration.

Test Plan

Built on Windows (MSVC 19.51 / VS 18):

cmake -B build --preset windows-release -DTHEROCK_AMDGPU_FAMILIES=gfx110X-dgpu
-DTHEROCK_ENABLE_ALL=OFF -DTHEROCK_ENABLE_COMPILER=ON
-DTHEROCK_FLAG_WINDOWS_DRIVER_BUILD=ON
cmake --build build --target artifact-group-compiler

Test Result

Build succeeded. The PDB is the only .pdb under build/artifacts, and lands in dbg rather than run:

amd-llvm_lib_generic/compiler/amd-comgr/stage/bin/amd_comgr_drivers.dll
amd-llvm_dbg_generic/compiler/amd-comgr/stage/bin/amd_comgr_drivers.pdb

Submission Checklist

  • Look over the contributing guidelines at https://github.com/ROCm/TheRock/blob/main/CONTRIBUTING.md.
  • Diff: 38 lines (+38 / -0) across 4 files Reviewer: lamb-j Review duration: 35544m
    All Vouch review confidence checks passed
    Residual risk 0.05 = Change Risk (0.29) × (1 − Review Confidence (0.85)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.29 · 38 lines diff across 4 files
    0.29
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.78 · 3 substantive comment(s)
    0.78
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    84%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.219
    Real PR Conversation Timeline
    7 items
    therock-pr-bot[bot] therock-pr-bot[bot] commented on Sep 11, 2026 05:15 UTC
    Bot

    <!-- therock-pr-bot-policy-check -->

    ✅ All Checks Passed — Ready for Review

    | Check | Status | Details |
    |---|:---:|---|
    | 📝 PR Description | ✅ Pass | — |
    | ⛔ Forbidden Files | ✅ Pass | — |
    | 🧪 Unit Test | ✅ Pass | PR does not contain code files — Unit Test auto-passed |
    | 🔎 pre-commit | ✅ Pass | — |
    | 🚫 Draft PR | 🔜 To Be Enabled | — |
    | 🚩 Feature Flag | 🔜 To Be Enabled | — |
    | 📊 Code Coverage | 🔜 To Be Enabled | — |
    | 🤖 therock-pr-bot | ✅ Pass | — |

    🎉 All checks passed! This PR is ready for review.

    📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

    🙋 Wish to Override Policy?

    therock-pr-bot[bot] therock-pr-bot[bot] commented on Sep 11, 2026 05:15 UTC
    Bot

    <!-- therock-pr-bot-fix-policies -->
    🎉 All checks passed! This PR is ready for review.

    lamb-j lamb-j approved these changes on Sep 25, 2026 17:06 UTC
    Approved Reviewer

    LGTM, thanks

    chinmaydd chinmaydd approved these changes on Sep 25, 2026 17:08 UTC
    Approved Reviewer

    LGTM

    ScottTodd ScottTodd commented on code on Sep 28, 2026 17:24 UTC
    Code Review
    compiler/pre_hook_amd-comgr.cmake:1
    @@ -14,3 +14,14 @@ else()
     endif()
     
     set(CMAKE_INSTALL_RPATH "$ORIGIN;$ORIGIN/llvm/lib;$ORIGIN/rocm_sysdeps/lib")
    +
    +# Debug info for comgr's own objects only; statically linked LLVM is left out
    +# to keep the PDB small.
    +# /Z7 rather than /Zi to avoid collision with LLVM's shared PCH (error C2859).
    +# /OPT:REF,/OPT:ICF restore the Release defaults that /DEBUG turns off.
    +# CMAKE_HOST_WIN32 rather than WIN32/MSVC, which are unset before project().
    +if(CMAKE_HOST_WIN32 AND THEROCK_FLAG_WINDOWS_DRIVER_BUILD)
    +  string(APPEND CMAKE_C_FLAGS " /Z7")
    +  string(APPEND CMAKE_CXX_FLAGS " /Z7")
    +  add_link_options("LINKER:/DEBUG,/OPT:REF,/OPT:ICF")
    +endif()

    Note that we set CMAKE_MSVC_DEBUG_INFORMATION_FORMAT here: https://github.com/ROCm/TheRock/blob/c0ff65998e493b51e7c5c94989d34c56c12a5d82/cmake/therock_compiler_config.cmake#L6-L11

    Docs: https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_DEBUG_INFORMATION_FORMAT.html

    For Debug and RelWithDebInfo this sets Embedded, i.e.

    Embedded

    Compile with -Z7 or equivalent flag(s) to produce object files with full symbolic debugging information.

    I generally prefer working through the CMAKE_MSVC_DEBUG_INFORMATION_FORMAT option instead of directly editing compiler flags and link options.

    ---

    I also wonder if https://github.com/ROCm/TheRock/blob/main/CMakePresets.json should set "amd-llvm_BUILD_TYPE": "Release" for Windows as it does for Linux. Maybe this doesn't even need to be scoped to just when THEROCK_FLAG_WINDOWS_DRIVER_BUILD is set, if we use presets more consistently across Windows and Linux (see also https://github.com/ROCm/TheRock/issues/5453)

    ScottTodd ScottTodd commented on Sep 28, 2026 17:25 UTC
    Reviewer

    This looks okay, but I'm wondering if we can accomplish the same thing through native CMake options and CMake presets.

    Reviewers
    Assignees
    YashDeshpande25 YashDeshpande25
    Labels
    risk: low confidence: 84.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 29.3% (LOW) · Higher = larger blast radius
    29.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 84.5% · Lower = rushed or shallow review
    84.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 4.5% · Safe to merge
    4.5%
    Repository