|
|
|
|
|
by Hizonner
670 days ago
|
|
I have also never programmed on Windows in my life. Seriously, not so much as a trivial script. But I would look up the right way to find the system installation if I were writing production code, or even personal-use code, that needed to know where it was. I also wouldn't walk the filesystem looking for a program I was relying on (and assuming filenames and installation locations, but evidently not with a definitive standard location in mind). If I had to do that, I would know there was something horribly wrong with my own design. Although I should probably already be clued into that if my chat program is having to fool with GPU arcana like that. Either some programmer has put thousands of other people's reliability and resources at risk by intentionally taking on something they're unqualified for and don't have the time to do right... or some manager has pushed somebody into that position. If you mean that the reality of commercial software is that it's written by half-qualified people under unreasonable time pressure, why should we have "empathy" for the people who make it that way? |
|
If I search Google for "nvidia-smi.exe", one of the top results is a Stack Overflow answer with 70 upvotes, describing exactly the approach taken by the linked code.
https://stackoverflow.com/a/57100016