Skip to content

Fix GPU Compilation Errors and Upgrade NVML Wrapper#7

Merged
shaik-noor merged 19 commits intomainfrom
test-builds
Dec 13, 2025
Merged

Fix GPU Compilation Errors and Upgrade NVML Wrapper#7
shaik-noor merged 19 commits intomainfrom
test-builds

Conversation

@shaik-noor
Copy link
Copy Markdown
Collaborator

This PR resolves compilation and linker errors in agent-core related to GPU monitoring, specifically addressing issues with nvml-wrapper version mismatches and missing MIG (Multi-Instance GPU) symbols.

Key Changes:

  • Upgraded nvml-wrapper: Bumped version to 0.10 to better align with modern NVML features.
  • Dynamic Loading for NVML Extensions: Switched from extern "C" static linking to dynamic loading (libloading) for extended NVML functions (PCIe stats, etc.) in
    nvml_ext.rs and gpu.rs
    . This prevents linker errors when symbols are missing from the system's NVML library.

MIG Collection Refactoring:

  • Removed duplicated MIG collection logic in gpu.rs
  • Corrected field access for BAR1MemoryInfo (renamed bar1Total/bar1Used to total/used).
  • Added proper use scopes and fixed type mismatches.

Formatting & Linting:

  • Applied strict cargo fmt fixes to gpu.rs (complex type indentation).
  • Fixed clippy lints and snake_case naming conventions in nvml_ext.rs

Verification:

  • Compilation: agent-core now compiles successfully with cargo build.
  • CI: lint-and-test job passes.
  • Unit Tests: Local tests for pcie_ext_stub_compiles pass.

Related Issues:

  • Fixes linker errors on Windows/Linux environments where static NVML symbols were missing.
  • Fixes build failures due to reduced BAR1 struct fields.

@shaik-noor shaik-noor self-assigned this Dec 13, 2025
@shaik-noor shaik-noor merged commit 2d8d773 into main Dec 13, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant