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

graphics() alternative nvidia-smi check #963

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Tellinq
Copy link

@Tellinq Tellinq commented Jan 18, 2025

This PR is more or less to get movement from #927 and #928

This aims to address a few things:

  1. Start with using the nvidia-smi symlinked path as a measure to avoid needing to scan the Driver Store.
  2. On a typical Windows installation with an NVIDIA graphics driver properly installed, the NVIDIA SMI symlink should never get tampered with unless an external program decides to do otherwise. While rare, if the symlink path somehow doesn't exist, the Driver Store scan will then happen
  3. Regarding the Driver Store scan, this mostly incorporates the changes made in graphics: optimize getNvidiaSmi() #927, but further condenses. graphics: optimize getNvidiaSmi() #927 also addresses an issue with the current main implementation where if a non-directory is parsed, an error would then be thrown and the scan would terminate without the nvidia-smi ever being found.

I noticed in commit e67aa92 that checking if a file or folder starts with nv was omitted. Fro my testing, and some friends, and the results in the conversation #927, this seems like this should have been fine to keep but then again the results I see is still a small sample size. If there was a reason why this was omitted originally that would be helpful to get movement on this PR.

Few ways this could go around:

  1. PR remains as is and should be good to go with both the fast path check and the driver store scan. I'm not too worried if this remains as is since the likelihood of the driver store scan ever being necessary is absolutely low unless the symlink somehow never gets created or gets tampered with.
  2. Omit the driver scan altogether, which would align with graphics: optimize getNvidiaSmi() #927 (comment). I would agree with this move partially aside from the fact that the nvidia-smi can get tampered with by any application with the right permissions so having the driver store scan as a fallback I feel is fine.
  3. Don't include the System32 symlinked path. This I would highly disagree with as if the driver store scan is the only portion that determines if an NVIDIA-SMI executable path exists will absolutely take up a huge amount of resources, especially with the Driver Store likely containing 700+ items. Sure, this PR will definitely lessen the amount of resources used compared to what is currently available (that is assuming the scan never encounters a non-directory).

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