Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with GPU metrics on Windows 24H2 #914

Open
TheRedfoox opened this issue Jun 16, 2024 · 3 comments
Open

Problem with GPU metrics on Windows 24H2 #914

TheRedfoox opened this issue Jun 16, 2024 · 3 comments

Comments

@TheRedfoox
Copy link

Describe the bug
Since the Windows 24H2 update, almost no GPU metrics (usage, temperature, power, etc.) come up. However, on another PC running Windows 23H2, the metrics come back correctly.

To Reproduce
Steps to reproduce the behavior:

  1. Use the function systeminformation.graphics().
  2. Run the application
  3. Observe GPU metrics

Current Output
GPU metrics (usage, temperature, power, etc.) are not available.

Expected behavior
GPU metrics (usage, temperature, power, etc.) should be available, as they are on a Windows 23H2 PC.

Environment (please complete the following information):

  • systeminformation package version: 5.22.11
  • OS: Windows 24H2
  • Hardware: i7 12700k, RTX 3080, 32Go RAM DDR4

To get all needed environment information, please run the following command:

┌─────────────────────────────────────────────────────────────────────────────────────────┐
│  SYSTEMINFORMATION                                                     Version: 5.22.11 │
└─────────────────────────────────────────────────────────────────────────────────────────┘

Operating System:
──────────────────────────────────────────────────────────────────────────────────────────
Platform         : Windows
Distro           : Microsoft Windows 11 Professionnel
Release          : 10.0.26100
Codename         : 
Kernel           : 10.0.26100
Arch             : x64
Hostname         : NZXT-DU-RENARD
Codepage         : 850
Build            : 26100
Hypervisor       : true
RemoteSession    :

System:
──────────────────────────────────────────────────────────────────────────────────────────
Manufacturer     : ASUS
Model            : System Product Name
Version          : System Version
Virtual          :

CPU:
──────────────────────────────────────────────────────────────────────────────────────────
Manufacturer     : Intel
Brand            : Gen Intel® Core™ i7-12700K
Family           : 6
Model            : 151
Stepping         : 2
Speed            : 3.61
Cores            : 20
PhysicalCores    : 12
PerformanceCores : 20
EfficiencyCores  :
Processors       : 1
Socket           : Other

Additional context
This problem appeared after the Windows 24H2 update. On another PC running Windows 23H2, GPU metrics are correctly displayed.

@TheRedfoox
Copy link
Author

After putting a few debuggers in the code, I realize that getNvidiaSmi() is in error

Line 397: Error: ENOTDIR: not a directory, scandir 'C:\WINDOWS\System32\DriverStore\FileRepository/a-volutenh3aposwc.inf_amd64_b9b81cb814cdca75.ini'
    at Object.readdirSync (VM262 node:fs:1527:3)
    at t.readdirSync (VM340 node_init:2:11289)
    at VM369 G:\Developer\sb-hardware-monitor\node_modules\systeminformation\lib\graphics.js:398:21
    at Array.filter (<anonymous>)
    at getNvidiaSmi (VM369 G:\Developer\sb-hardware-monitor\node_modules\systeminformation\lib\graphics.js:397:56)
    at nvidiaSmi (VM369 G:\Developer\sb-hardware-monitor\node_modules\systeminformation\lib\graphics.js:420:26)
    at nvidiaDevices (VM369 G:\Developer\sb-hardware-monitor\node_modules\systeminformation\lib\graphics.js:444:20)
    at VM369 G:\Developer\sb-hardware-monitor\node_modules\systeminformation\lib\graphics.js:837:30
    at process.processTicksAndRejections (VM225 task_queues:77:11)

@TheRedfoox
Copy link
Author

With even more searching, I see that fs.readdirSync(basePath) would expect to have only directories but actually with my explorer here C:\Windows\System32\DriverStore\FileRepository I see .ini's which may have the same name as some folders.

I think that since Windows 24H2 there are files in FileRepository, which wasn't the case before and which now poses a problem.

@TheRedfoox
Copy link
Author

Something like this should solve the problem by simply checking whether the element we're testing is actually a directory.

const candidateDirs = fs.readdirSync(basePath).filter(dir => {
  if (fs.statSync([basePath, dir].join('/')).isDirectory()) {
    return fs.readdirSync([basePath, dir].join('/')).includes('nvidia-smi.exe');
  }
});

I don't know if it's up to me to make a pull request or how to format it to propose this change to fix this problem on Windows 24H2.
In any case, I'm available to fix this problem as soon as possible.

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

No branches or pull requests

1 participant