Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.
This repository was archived by the owner on May 12, 2026. It is now read-only.

Intel NPU - wrong/missing values #622

Closed

Description

@sand-r

Is there an existing issue for this?

  • I searched the existing issues and did not find anything similar.

Current Behavior

On a Lunar Lake laptop (Intel NPU) the NPU page in Resources shows NPU Frequency and Link as N/A, but the kernel exposes related sysfs nodes under /sys/class/accel/accel0/device. Total usage calculation also seems to be off.

Device / driver

$ readlink -f /sys/class/accel/accel0/device/driver
/sys/bus/pci/drivers/intel_vpu

$ cat /sys/class/accel/accel0/device/uevent
DRIVER=intel_vpu
PCI_CLASS=120000
PCI_ID=8086:643E
PCI_SUBSYS_ID=17AA:2339
PCI_SLOT_NAME=0000:00:0b.0
MODALIAS=pci:v00008086d0000643Esv000017AAsd00002339bc12sc00i00

Frequency sysfs

ACCEL=/sys/class/accel/accel0/device

$ cat $ACCEL/npu_max_frequency_mhz
1900

$ cat $ACCEL/npu_current_frequency_mhz
0

Power related

$ cat $ACCEL/power_state
D3hot
$ cat $ACCEL/power/runtime_status
suspended

Counters present

$ cat $ACCEL/npu_busy_time_us
979473
$ cat $ACCEL/npu_memory_utilization
68714496

Link-related sysfs exists but probably irrelevant

for f in current_link_speed current_link_width max_link_speed max_link_width; do
  echo "== $f =="; cat "$ACCEL/$f"
done

== current_link_speed ==
Unknown
== current_link_width ==
0
== max_link_speed ==
Unknown
== max_link_width ==
255
Image

Expected Behavior

No response

Steps to Reproduce

No response

Debug Logs

Expand logs
REPLACE THIS SENTENCE WITH THE TERMINAL OUTPUT OF THE AFOREMENTIONED COMMAND.

Environment

Anything Else?

No response

Activity

  1. gordan-ramsey commented on Feb 16, 2026

    @gordan-ramsey

    The same problem exist for my AMD NPU on AMD Ryzen 7 AI 350 but it's worse.
    At least you are getting utilization info.

    user@pop-os:~$ readlink -f /sys/class/accel/accel0/device/driver
    /sys/bus/pci/drivers/amdxdna
    user@pop-os:~$ cat /sys/class/accel/accel0/device/uevent
    DRIVER=amdxdna
    PCI_CLASS=118000
    PCI_ID=1022:17F0
    PCI_SUBSYS_ID=1043:20CF
    PCI_SLOT_NAME=0000:04:00.1
    MODALIAS=pci:v00001022d000017F0sv00001043sd000020CFbc11sc80i00
    user@pop-os:~$
    
    Linux pop-os 6.18.7-76061807-generic 
    #202601231045~1769703228~24.04~cb87b5b SMP PREEMPT_DYNAMIC Thu J x86_64 x86_64 x86_64 GNU/Linux
    
    Image Image
  2. nokyan commented on Feb 25, 2026

    @nokyan
    Owner

    Hi, thanks for the issue and sorry for taking so long to respond. Did this happen on Resources 1.9.1 as well, @sand-r? Also, is the NPU utilization metric in the Processes tab also that high for the processes utilizing your NPU?

  3. nokyan commented on Feb 25, 2026

    @nokyan
    Owner

    Regarding core frequency on intel_vpu, I've committed to the branch bugfix/622-implausible-and-missing-values, I'd appreciate if you could check that out

  4. sand-r commented on Feb 26, 2026

    @sand-r
    Author

    Regarding core frequency on intel_vpu, I've committed to the branch bugfix/622-implausible-and-missing-values, I'd appreciate if you could check that out

    I think you forgot to push that branch.
    I could not find an NPU column on the processes tab to see how utilization is displayed there.

    I'm pretty sure it was also the same on 1.9.1 but if you let me know what should I test specifically, I can take a look.

  5. nokyan commented on Feb 26, 2026

    @nokyan
    Owner

    Oh, you're correct, sorry, branch is now actually pushed. 😅

  6. sand-r commented on Feb 26, 2026

    @sand-r
    Author

    Oh, you're correct, sorry, branch is now actually pushed. 😅

    Tested the branch, the frequency fix wasn't working, and usage is still off (correct first two digits but wrong decimal place). I had AI help me dig into the code and it found two issues:

    1. core_frequency() passes a bare relative path to read_parsed, so it reads from the working directory instead of the sysfs device path. It silently fails and falls back to hwmon_core_frequency() (the old behavior). Needs self.sysfs_path().join() like usage() already does for npu_busy_time_us.
    2. usage() divides npu_busy_time_us (microseconds) by the timestamp delta (seconds) without converting units, so the result is ~1,000,000x too large instead of a 0.0–1.0 fraction.
      diff --git a/src/utils/npu/intel.rs b/src/utils/npu/intel.rs
      --- a/src/utils/npu/intel.rs
      +++ b/src/utils/npu/intel.rs
      @@ -81,7 +81,7 @@ impl NpuImpl for IntelNpu {
               let delta_timestamp = new_timestamp - last_timestamp;
               let delta_busy_time = new_busy_time.saturating_sub(last_busy_time) as f64;
    
      -        Ok(delta_busy_time / delta_timestamp)
      +        Ok(delta_busy_time / 1_000_000.0 / delta_timestamp)
           }
    
      @@ -100,7 +100,7 @@ impl NpuImpl for IntelNpu {
    
           fn core_frequency(&self) -> Result<f64> {
      -        read_parsed::<f64>("device/npu_current_frequency_mhz")
      +        read_parsed::<f64>(self.sysfs_path().join("device/npu_current_frequency_mhz"))
                   .map(|mhz| mhz * 1_000_000.0)
                   .or_else(|_| self.hwmon_core_frequency())
           }
    

    With both fixes applied, frequency and usage display correctly.

    Image
  7. nokyan commented on Feb 26, 2026

    @nokyan
    Owner

    Thanks a lot (though admittedly those errors are a bit embarassing for me 😅), I'll apply the fixes shortly. :)

  8. nokyan commented on Feb 26, 2026

    @nokyan
    Owner

    I've committed the fix, mind testing it?

  9. sand-r commented on Feb 26, 2026

    @sand-r
    Author

    Tested and it works, thank you!

  10. nokyan commented on Feb 26, 2026

    @nokyan
    Owner

    In regards to amdxdna, @h-n-a, can you use the discussion starting here to check whether the amdxdna firmware is loading correctly?
    Also, if you're familiar with sifting through log files, can you run either RUST_LOG=trace ~/.local/share/flatpak/app/net.nokyan.Resources/current/active/files/libexec/resources/resources-processes -o -r if you've installed Resources as a Flatpak locally or RUST_LOG=trace /var/lib/flatpak/app/net.nokyan.Resources/current/active/files/libexec/resources/resources-processes -o -r if you've installed Resources as a Flatpak system-wide while you're running an NPU ᚃorkload and look for lines containing "amdxdna" in the logs of the command?

  11. nokyan commented on Feb 27, 2026

    @nokyan
    Owner

    As this issue was originally intended for Intel NPUs, I'll close it for now. :)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions