Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: CPU temperature

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    CPU temperature

    Fellow Pascal game developers!


    I'm happy to show the first achievement in the new year 2023.
    Accessing and processing some data from my new NUC system's temperature sensors.


    Program for data access written in Lazarus Pascal, animated GIF generated with GIMP. OS is Debian.


    The GIF below shows the temperature during the process of generating an animated GIF with GIMP.
    Total shown time 24 minutes. The red area is the CPU temperature, the blue line is the NVMe, which happens to be a WD Blue.
    The green dots are for something Intel calls package temperature.





    The image may be removed from the server at some later time

  2. #2
    Interesting. Which library are you using for accessing HW data?

  3. #3
    I have no idea which library is involved in accessing the data.

    it seems as for (my) Linux system the sensor data can be collected from plain text files located in one of four following directories:


    /sys/class/hwmon/hwmon0/
    /sys/class/hwmon/hwmon1/
    /sys/class/hwmon/hwmon2/
    /sys/class/hwmon/hwmon3/

    It also seems as the sensors are assigned different directories after each restart.

    Fortunately there are only four directories (in my system) and there is a plain text file named 'name' in each directory saying which sensors were assigned there during the last/current restart.

    /sys/class/hwmon/hwmon'*/name

    So first make a routine to check which directory to look in and then retrieve the actual data from files of the type

    /sys/class/hwmon/hwmon*/temp*_input

    Then you do whatever magic you want to do with this temperature data
    it seems the temperature files are updated every 2 seconds.

    From what I read different systems behave differently. So I guess it depends on what you got under the hood. So far I have only tried this on my own computer.

  4. #4
    So you are just parsing files that were stored by some other sensor monitoring program.

  5. #5
    Quote Originally Posted by SilverWarior View Post
    So you are just parsing files that were stored by some other sensor monitoring program.
    I guess. Makes it incredibly convenient, except for the minor hassle of deciding where to look. I have no idea how the data ends up in those files. I certainly haven't installed any monitoring program. I guess I have to thank team Linux and Intel and some unknown heroes.

  6. #6
    Quote Originally Posted by Jonax View Post
    I guess. Makes it incredibly convenient, except for the minor hassle of deciding where to look. I have no idea how the data ends up in those files. I certainly haven't installed any monitoring program. I guess I have to thank team Linux and Intel and some unknown heroes.
    Well Linux actually has The Linux Hardware Monitoring kernel API https://docs.kernel.org/hwmon/hwmon-kernel-api.html that allows easy and standardized monitoring of computer hardware. It even allows of dumping information to files like the one you are using.
    Now I don't know enough about Linux to tell you where and how you can set this up. I do know here are several programs that do make this much easier. And there is available API that you can use directly from your program to retrieve current information. But i haven't seen readily library for pascal so far.

  7. #7
    Quote Originally Posted by Jonax View Post
    something Intel calls package temperature.
    That thing is quite treacherous. I was monitoring my laptop for more than a decade with SpeedFan in Win7. There are three temps, ACPI, Intel Core 0 and Intel Core 1. The acpi one follows the core 0 graph closely, a bit more smoothed, with core 1 colder, zigzagging likewise a bit below them. No notable surprises in this behavior in 10 years.

    Then, suddenly, I play Brutal Doom and get a huuge overdraw and fps slowdown: it's Intel integrated gpu and I am guarding a doorway rushed by half the monsters on the map (random map generator sometimes makes things FUN), like 300 spartans with a bfg. Of course the doorway gets splattered over with so many layers of blood decals it brings Intel HD 3000 to its knees.

    But there's the interesting part: I look at the graph and suddenly see this "package temperature" soaring towards 90C, away from the cores steadily zigzagging around 75.
    Conclusion: it's the only sensor that takes gpu into consideration - and that gpu *could* heat up horribly in rare, rare circumstances.
    I'd provide a screenshot (a screnshot is worth a thousand words) but my site's Let'sEncrypt config is broken and I am still too lazy to fix it.

    Real use cases, wild and woolly, always have untold number of surprises in store.

  8. #8
    Quote Originally Posted by Chebmaster View Post
    But there's the interesting part: I look at the graph and suddenly see this "package temperature" soaring towards 90C, away from the cores steadily zigzagging around 75.
    Conclusion: it's the only sensor that takes gpu into consideration - and that gpu *could* heat up horribly in rare, rare circumstances.
    If you call that rare circumstances then I guess you are one of the smarter people that keeps V-Sync enabled all the time.
    There are so many games (both Indy and AAA) that are literally capable of melting integrated GPU's when simply left at main menu since it reaches so high FPS there. High FPS even when doing simple 2D rendering of main menu can still cause High GPU utilization and when you consider that in order to reach such high FPS the CPU also needs to send lots of render calls to the GPU (high utilization of at least one CPU core) you can quickly understand why this can be so dangerous.

    I'd provide a screenshot (a screnshot is worth a thousand words) but my site's Let'sEncrypt config is broken and I am still too lazy to fix it.

    Real use cases, wild and woolly, always have untold number of surprises in store.[/QUOTE]

  9. #9
    Quote Originally Posted by SilverWarior View Post
    I guess you are one of the smarter people that keeps V-Sync enabled all the time.
    Nope.
    HD 3000 is just that wimpy.
    OpenArena (a quake3 clone) only can 60 fps at 1024x768
    Factorio ran ~25fps on minimals, causes an overheat shutdown, stopped playing @this machine
    Team Fortress 2 ran ~30fps on minimals, causes an overheat shutdown, stopped playing @this machine
    So, I only play outdated Zandronum + Brutal Doom here, at 1280x720, at that.

    Note that I managed to heat it to 85C once, by rendering a rotating cube with immense supersampling (more than 4k, AFAIR) downsampled to FullHD in a pixel shader.
    But even then, the package graph never strayed far from the Core 0 graph.

    Hmm... The circumstances were quite specific: tons of overdraw *but* most of those decals were the same texture, quite stretched.
    Maybe the gpu in my case is always limited by how much system memory bandwidth it could scrounge -- but if all textures fit in its own cache it has a chance to go all out and clock up?

  10. #10
    Quote Originally Posted by Chebmaster View Post
    Nope.
    HD 3000 is just that wimpy.
    Can't comment on other games but I do know that Factorio is CPU heavy game that actually supports mutit-hreading and thus can fully utilize both of your CPU cores. Having bigger base in Factorio can cause FPS drop even on my Acer Aspire 6530 laptop with 2 Core AMD Athlon processor since it maxes out both CPU cores. At the same time dedicated ATI Mobility Radeon HD 3200 graphics card never even reaches toward full utilization. And yes this is laptop that is actually capable of running original Crysis albeit on minimal settings.

    Any way when was the last time you tried playing Factorio on your laptop?
    Factoprio developers managed to do some huge optimizations of the game before its full release like optimized belt simulation, optimized robotic path-finding and simulation, massively optimized biter path-finding, redesigned pipe fluid simulation, masive path-finding, collision detection and overall simulation of trains and much more.
    They even managed to make some improvements of rendering pipeline and thus improving performance even on low end computers with integrated graphic cards.

    Any way in order to see if your computer is CPU or GPU bound I would recommend using tools like Process Explorer (https://learn.microsoft.com/en-us/sy...ocess-explorer) that can monitor your system utilization in real time. This was most used application on my laptop since it allowed me to track down any background processed that could hog down my computer. Not to mention that with its help I managed to adjust graphics settings of individual games to the point where neither my CPU or GPU would be fully utilized.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •