[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: smart fans



On 8/23/21 5:05 PM, Emanuel Berg wrote:
David Christensen wrote:

But changing the profile (governor) doesn't produce any
(noticable?) sound level change and also the temperature of
the CPU and the GPU seem unaffected.

You will not notice a change in CPU fan temperature or speed
profiles as a function of the Linux governor setting until
the motherboard CPU fan speed control is working and you
change the CPU load.

Here is a Perl one-liner that should peg one core:

$ perl -e "1 while 1"

OK, I wrote a script [last] and here is the result

$ temp-gov
CPU C (33.50 45.75) (100 iterations) conservative
CPU C (45.88 46.38) (100 iterations) userspace
CPU C (46.38 46.75) (100 iterations) powersave
CPU C (46.75 47.00) (100 iterations) ondemand
CPU C (47.00 47.00) (100 iterations) performance
CPU C (47.00 47.25) (100 iterations) schedutil

Hm ... the result seems to be pretty much identical for the
governors anyway?

#! /bin/zsh
#
# this file:
#   https://dataswamp.org/~incal/conf/.zsh/temp

temp-gov () {
     local t=100

     local cpu
     local cpu_min
     local cpu_max

     perl -e '1 while 1' &
     local pid=$!
     sleep 10

     local i
     local g
     for g in $(cpufreq-info -g); do
         sudo cpufreq-set -g $g
         cpu_min=999
         cpu_max=0
         for i in {0..$t}; do
             cpu=$(sensors -j | jq -a '.["k10temp-pci-00c3"].Tdie.temp1_input')
             (( $cpu < $cpu_min )) && cpu_min=$cpu
             (( $cpu > $cpu_max )) && cpu_max=$cpu
         done
         printf "CPU C (%.2f %.2f) (%d iterations) %s\n" $cpu_min $cpu_max $t $g
     done

     kill $pid
}


For a CPU with N cores (N=4 for an AMD Ryzen 3 3200G?) and an otherwise unloaded system, your test procedure should be something like:

   loop over governor choices
     set governor
      loop 3 times
        sleep 60 seconds
        print statistics
      endloop
     loop from 1 to N
       start background process
       loop 10 times
         sleep 6 seconds
         print statistics
       endloop
     endloop
     kill all background processes
   endloop


"print statistics" should include time, governor setting, number of background processes running, and CPU temperature. If would be nice to also include system loading percent, CPU frequency, and CPU fan speed.


David


Reply to: