-
-
Notifications
You must be signed in to change notification settings - Fork 311
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
graphics: optimize getNvidiaSmi() #927
base: master
Are you sure you want to change the base?
Conversation
narrows down candidate directories smarter, uses stat to check for file existence instead of listing all files in the directory and then checking inside that array, and also avoids calling stat for the same file multiple times.
lib/graphics.js
Outdated
}); | ||
let newestNvidiaSmi = null; | ||
for (const dir of fs.readdirSync(basePath)) { | ||
// nvidia-smi will only be located in directories starting with `nvdm`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this may or may not be true. we may want to broaden this to just look inside all directories that start with nv
(case insensitive.)
Heloo jhgg, Thanks for letting my borrow you lamborghini that one day. |
at least on my system, |
from my understanding that's a legacy path. can you check the creation time? |
11/07/2024, last time i updated my drivers |
Mine is also located in Created: July 21, 2024 So I am assuming I installed the driver on the 21st, and it was released on the 11th |
When a driver is installed, it gets staged into the driver store, and then most of its files get a corresponding symlink in
There is absolutely no need to scan the driver store. |
We can be sure nvidia-smi.exe always gets symlinked, because, when looking at a driver's INF file, we can find the following: And every section in the driver INF has a CopyFile directive for that: It's not legacy, as they do not implement the corresponding state for Run From Driver Store |
narrows down candidate directories smarter, uses stat to check for file existence instead of listing all files in the directory and then checking inside that array, and also avoids calling stat for the same file multiple times.