Repository navigation
Add Intel NPU support (intel_vpu accel driver) - #526
Merged
Merged
Conversation
Add a backend for Intel NPUs (Meteor Lake, Arrow Lake, Lunar Lake,
Panther Lake) driven by the in-kernel intel_vpu/ivpu accel driver.
Devices are discovered under /sys/class/accel by their driver link and
read entirely from sysfs, so no extra library is needed:
- utilization from the cumulative npu_busy_time_us counter
- current and maximum clock from npu_{current,max}_frequency_mhz
(0 MHz while the NPU is power-gated)
- memory allocated by the NPU (npu_memory_utilization) against total
system RAM, since the NPU has no dedicated memory
The backend is enabled by default on Linux behind the new
INTEL_NPU_SUPPORT CMake option. Per-process reporting is not
implemented yet.
Tested on an Arrow Lake Core Ultra 9 285K (8086:ad1d) alongside an
NVIDIA RTX 5090 and the integrated Intel GPU.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Add the two NPU PCI IDs already handled by the in-kernel intel_vpu driver so those parts are named instead of falling back to their ID. - Report the generation as device_architecture as well. - Bound the pdev copies to PDEV_LEN to silence -Wformat-truncation. - Move the vendor extern to file scope to silence -Wnested-externs. - Add the missing copyright line and apply clang-format.
The NPU has no dedicated memory, and Qualcomm/Rockchip expose system-wide memory pressure (MemTotal/MemAvailable). Use the same convention here so the NPU memory columns mean the same thing across backends. This drops the NPU-resident bytes from npu_memory_utilization.
Describe the supported parts, the build option, the sampling interval caveat, the memory semantics and the kernel versions exposing each metric.
Owner
|
I merged current master into the branch and added a few follow-ups:
Pushed as 7d21b86. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a backend for Intel NPUs exposed by the in-kernel
intel_vpu(ivpu) accel driver: Meteor Lake, Arrow Lake, Lunar Lake and Panther Lake.How it works
/sys/class/accel/accel*whosedevice/driverisintel_vpunpu_busy_time_usdivided by wall timenpu_current_frequency_mhz/npu_max_frequency_mhz(0 MHz while power-gated)npu_memory_utilizationagainst total system RAM, since the NPU has no dedicated memoryINTEL_NPU_SUPPORTCMake option, on by default on Linux; registered asgpu_processing_unit_npu, like the Rockchip backendNot included yet
Testing
Core Ultra 9 285K (8086:ad1d), kernel 7.0, alongside an RTX 5090 and the Arrow Lake iGPU. The NPU is detected and shown as "Intel NPU (Arrow Lake)", and idle readings are correct (0 %, 0 MHz, 65 MB allocated). Not yet tested under an NPU workload.
🤖 Generated with Claude Code