Given how everything is a file in Linux, processes don't magically get their information out of nowhere. If you're seeing information without sudo, then that means there's a file somewhere in sysfs, proc, or devfs that can be accessed as a user. Otherwise it could also just be from the kernel ABI (syscalls) rather than a file, where information could also be gathered from functions like ioctl() and socket() if not other direct syscalls like getcpu().
So with that in mind, I'm looking for the source files nvidia-smi reads for its information
In fact, I'd like to extend this further than Nvidia alone since nouveau, radeontop, AMDGPU, and whatever Intel uses, also have similar ways of getting such information that are untold for some reason...
Which files do these processes get their information from?
My ultimate goal is to read these files with Conky and display graphs for them 16 times a second for every GPU in my system, just like I'm doing for my system CPU and RAM use.
ioctl()
orsocket()
, including things like i2c and all that. :P