Giter VIP home page Giter VIP logo

osx-cpu-temp's People

Contributors

ad-si avatar camlloyd avatar heegard avatar hnw avatar hoop33 avatar isghe avatar larryhynes avatar lavoiesl avatar randall77 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

osx-cpu-temp's Issues

CPU Temperature is taken from the Proximity Sensor

Issue

The current values of the temperature for the CPU is taken from the Proximity sensor (located on the CPU Cooler). Obviously, the CPU Cooler is cooler than the CPU die. Overheating and temperature throttling is related to the temperature of the cores. This is why Intel Power Gadget is using the values from the cores (I think it is making an average since each core has its temperature but it is only showing one value). Unless it is under serious work, the Proximity sensor will always be lower by 5-20°C.

Configuration

Running macOS Catalina 10.15.6 on MacBookPro16,2

Behaviors

Current behaviour

> ./osx-cpu-temp
45.4 °C

Expected behaviour

It should return the temperature of the GPU

> ./osx-cpu-temp
55.3 °C

Possible Fix

Change the SMC key to one of the cores, preferably the first or second one to ensure compatibility on dual-core processors (or take the average of all the cores available).

Output is "0.0°C" on a mid-2013 MacBook Air with Mavericks (10.9.1)

$ git clone https://github.com/lavoiesl/osx-cpu-temp.git
(…)
$ make
cc -O2 -Wall -framework IOKit -o osx-cpu-temp smc.c
$ ./osx-cpu-temp
0.0°C
$ uname -a
Darwin mbf.local 13.0.0 Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64

GPU Temperature is Broken

Issue

The current SMC keys to obtain the GPU temperatures are not working anymore. Seems like Catalina changed the keys.

Configuration

Running macOS Catalina 10.15.6 on MacBookPro16,2

Behaviors

Current behaviour

> ./osx-cpu-temp -g
0.0 °C

Expected behaviour

It should return the temperature of the GPU

> ./osx-cpu-temp -g
52.5 °C

Possible Fix

I think there is an error with the key that is searched.

"Fan 0 - Exhaust at 0 RPM (0%)" on Mac mini (Mid 2011), High Sierra

Built/ran the current code on a Mac mini (Mid 2011) running macOS 10.13.6 with Xcode 10.1. It doesn't seem to be able to read the fan speed.

osx-cpu-temp $ ./osx-cpu-temp -F
128.5°F
osx-cpu-temp $ ./osx-cpu-temp -f
Num fans: 1
Fan 0 - Exhaust   at 0 RPM (0%)

The fan is working, and the app "Macs Fan Control" shows that the current RPM is right around 1800 (the fan's minimum speed). I also tried smcFanControl and that shows a correct-looking RPM value, too.

older macmini needs small tweek in smc.c

I have an older macmini (some details below). The compiler wouldn't work without this small change:

215c215,216
<     for (int i = 0; i < 10; i++) {
---
> 	int i;
>     for (i = 0; i < 10; i++) {
231c232,233
< 	for (int i = 0; i < nfans; i++) {
---
> 	int i;
> 	for (i = 0; i < nfans; i++) {

I guess the compiler doesn't allow declarations in the "for loop". This small change allows it to compile and run.

-Chris

Hardware Overview:

  Model Name: Mac mini
  Model Identifier: Macmini1,1
  Processor Name: Intel Core Duo
  Processor Speed: 1.66 GHz
  Number Of Processors: 1
  Total Number Of Cores: 2
  L2 Cache: 2 MB
  Memory: 2 GB
  Bus Speed: 667 MHz

Software:

System Software Overview:

  System Version: Mac OS X 10.6.8 (10K549)
  Kernel Version: Darwin 10.8.0

CPU temp stuck

Hey,

I'm running osx-cpu-temp on Catalina (10.15.2) on a 2015 MacBook Pro 13".

Recently I have noticed that temperatures only update whilst my Mac is connected to power.

There was about a 5-10 second wait between each command in the test below:

~ $ echo Running off battery
Running off battery
~ $ osx-cpu-temp
42.9°C
~ $ osx-cpu-temp
42.9°C
~ $ osx-cpu-temp
42.9°C
~ $ echo Charger connected
Charger connected
~ $ osx-cpu-temp
39.0°C
~ $ osx-cpu-temp
38.8°C
~ $ osx-cpu-temp
38.5°C

It seems that this issue occurs whilst using iStats also. However Intel power gadget is working just fine.

This is very strange as a couple of weeks ago it was working fine.

Is anybody else experiencing this issue?

Thanks

Does not install with clib

~❯ clib install lavoiesl/osx-cpu-temp
       fetch : lavoiesl/osx-cpu-temp:package.json
gzip: osx-cpu-temp-0.0.0.tar.gz: not in gzip format
sh: line 0: cd: /var/folders/sw/j7lqmx85253dcbvjw78p4d7c0000gn/T//osx-cpu-temp-0.0.0: No such file or directory

Consistently getting no data for Fans - Mojave 10.14.5

Hey,

I've recently found out about this project, really enjoying it and it is working perfectly for CPU temp, but it seems to be buggy when talking about fan info

❯ osx-cpu-temp -f
Num fans: 1
Fan 0 - Exhaust   at 0 RPM (0%)

I've added this info to the bottom of my console so It's running that command every 5 seconds and I see the the 0 RPM (0%) most of the time, altough sometimes it seems to render accurate data.

MacBookPro9,1 running Ventura 13.5 with OpenCore Legacy Patcher 1.3.0

Bonjour M. Lavoie,

I had to change in smc.c :
result = IOServiceGetMatchingServices(kIOMainPortDefault, matchingDictionary, &iterator);

to:

result = IOServiceGetMatchingServices(kIOMasterPortDefault, matchingDictionary, &iterator);

to get it to make it :-), and run fine.

Thank's
jrb.

Homebrew formula

Hey there,

I wrote a Homebrew formula for your program, in case someone doesn't want to use CLibs.

You can access it with:

brew tap gwerbin/homebrew-tap
brew install osx-cpu-temp

I wrote it for personal use, but if you're interested I can make a PR to the Hombrew team. Tagging a release (even if it's a meaningless 0.1.0 or 1.0.0) would help, so it doesn't get relegated to the HEAD-only tap.

sudo make install overwrites /usr/local/bin folder

I'm running MacOS 10.12.2. I don't know if there already existed a /usr/local/bin folder, but after compiling your program, I ran "sudo make install" and then listed the contents of /usr/local/bin and was informed it was not a folder, but an executable file. So I ran it and it was the temperature program. I renamed it to osx-cpu-temp, then created a new /usr/local/bin directory, then moved it in there. It works fine now but I'm afraid the "sudo make install" command might have overwritten /usr/local/bin with your program. You might want to check on this. Thank you for the program.

Question about Fanspeed

Hello there! First off, great tool, works quite well!

I have a question about following code snippet:

float rpm = actual_speed - minimum_speed;

What is it supposed to do? I ask because a few lines further up in that method you have read from SMCGetFanRPM(key) into local variables for minimum, maximum and actual (fan)speeds. I seem to find the variable actual_speed seems to be quite plausible on my machine, so i was wondering what your line of thought might be?

I am using a Macmini3,1 (thats a late 2009 mac mini, i think) on OS X El Capitan 10.11.6 and it is reporting "Fan 0 - Master at 318 RPM (8%)", which seems a little low. The actual_speed variable is reading 1818, which seems quite plausible.

Disagrees with Intel Power Gadget

osx-cpu-temp reports ~46C while Intel Power Gadget reports 54C. The discrepancy increases when the machine is under heavy load (osx-cpu-temp doesn't increase appreciably, while IPG goes to 100C). I'm using a 15" mid-2012 rMBP (MacBookPro10,1).

Screen Shot 2019-06-01 at 8 24 06 AM

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.