How to get system temp and other info on linux [SOLVED]
-
Hello!
I am new to qt and i want to know what libraries i need to get the system info from a linux system.
I want to get the GPU temperatures and The CPU.
Can someone help me? -
For CPU temps and and at least for open source AMD GPU drivers you should be
able to use libsensors from lmsensors, for proprietary NVIDIA and and AMD drivers
you need to use the interfaces they provide, if they even do. -
@Huulivoide Thanks for the answer.
i was kinda hoping for libraries tho.
is this the only way? -
Hi and welcome to devnet,
Did you took a look at the proc and sys filesystem ?
-
I wouldn't use proc directly in this case as the sensor information provided there depends on the actual hardware. Like @Huulivoide suggested using lmsensors is much nicer as it provides a high level interface.
Edit: Ok, of course the sensor information depends on the actual hardware. What I wanted to say is that the way the info is presented there depends on the hardware (the drivers). E.g. different file paths and names.
-
@Wieland I agree with you about using lmsensors for the sensor part. However, since the OP mentioned system info in general, proc and sysfs contain most of these.
-
once again thank you all!
looks easier to be made with lmsensors so i am going to do it with that.
Again thank you all!