Code Monkey home page Code Monkey logo

Comments (5)

tbaumann avatar tbaumann commented on June 2, 2024

Is the issue perhaps "k10temp" vs "amdgpu-pci-2100" in https://github.com/AdnanHodzic/auto-cpufreq/blob/master/auto_cpufreq/core.py#L1281C42-L1281C51 ?

from auto-cpufreq.

tbaumann avatar tbaumann commented on June 2, 2024

The python package used returns this structure

{'amdgpu': [shwtemp(label='edge', current=62.0, high=97.0, critical=97.0)], 'nvme': [shwtemp(label='Composite', current=40.85, high=69.85, critical=84.85)], 'k10temp': [shwtemp(label='Tctl', current=49.125, high=None, critical=None), shwtemp(label='Tccd1', current=39.5, high=None, critical=None), shwtemp(label='Tccd3', current=41.75, high=None, critical=None), shwtemp(label='Tccd5', current=40.25, high=None, critical=None), shwtemp(label='Tccd7', current=40.5, high=None, critical=None)], 'kraken3': [shwtemp(label='Coolant', current=35.0, high=None, critical=None)], 'iwlwifi_1': [shwtemp(label='', current=41.0, high=None, critical=None)]}

It contains k10temp

from auto-cpufreq.

tbaumann avatar tbaumann commented on June 2, 2024

The temperatures loaded by psutil are unsurprisingly accurate

print(psutil.sensors_temperatures()['k10temp'][0].current )
90.75

from auto-cpufreq.

tbaumann avatar tbaumann commented on June 2, 2024

Nevermind. The nixpackages code is just very old

    # temperatures
    core_temp = psutil.sensors_temperatures()
    temp_per_cpu = [float("nan")] * online_cpu_count
    try:
        if "coretemp" in core_temp:
            # list labels in 'coretemp'
            core_temp_labels = [temp.label for temp in core_temp["coretemp"]]
            for i, cpu in enumerate(cpu_core):
                # get correct index in core_temp
                core = cpu_core[cpu]
                cpu_temp_index = core_temp_labels.index(f"Core {core}")
                temp_per_cpu[i] = core_temp["coretemp"][cpu_temp_index].current
        else:
            # iterate over all sensors
            for sensor in core_temp:
                # iterate over all temperatures in the current sensor
                for temp in core_temp[sensor]:
                    if temp.label == 'CPU':
                        temp_per_cpu = [temp.current] * online_cpu_count
                        break
                else:
                    continue
                break
            else: # if 'CPU' label not found in any sensor, use first available temperature
                temp = list(core_temp.keys())[0]
                temp_per_cpu = [core_temp[temp][0].current] * online_cpu_count
    except Exception as e:
        print(repr(e))
        pass

from auto-cpufreq.

tbaumann avatar tbaumann commented on June 2, 2024

Works with the flake

from auto-cpufreq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.