SkyLandTW / clevo-indicator

Ubuntu fan control indicator for Clevo laptops
The Unlicense
137 stars 68 forks source link

No GPU temperature and just one fan working #14

Open danigamba opened 8 years ago

danigamba commented 8 years ago

Hello, as title clevo-indicator can't read my gpu temperature and just one of the two fans i have is working on my Clevo P640RE.

Here my io's, 000000 00 00 00 c1 5d 63 64 2e 34 00 00 00 00 00 00 00 000010 05 00 00 00 00 00 e4 0f 00 00 58 0f 00 00 00 00 000020 00 00 5c 2b 00 00 02 00 00 00 9f 09 00 00 3e 0b 000030 00 00 aa 2f 00 00 00 00 4a 00 96 01 00 00 00 00 000040 00 00 00 00 00 00 00 00 00 00 50 36 34 30 52 45 000050 00 00 53 4d 50 2d 43 4f 53 34 78 0b 00 00 4c 49 000060 4f 4e 00 00 00 00 18 0c 02 00 00 00 00 00 00 00 000070 00 00 00 00 00 00 00 00 30 0a 01 a5 00 1b 00 00 000080 c2 01 00 00 00 00 01 00 00 00 00 00 00 00 00 00 000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 * 0000c0 00 00 00 00 00 00 00 00 02 03 3d 00 c9 00 99 7f 0000d0 03 10 04 a7 00 00 00 0f 63 80 05 09 00 07 87 00 0000e0 00 00 90 00 01 80 00 00 00 00 00 00 00 00 00 00 0000f0 68 81 c2 81 dd 00 00 00 00 40 00 04 00 00 00 00 000100 i'm trying to figure this out my c and low level programming is not my field, Anyway good job for the indicator, still pretty usefull to me. Thak you

Cotix commented 8 years ago

If you can figure out which of these numbers correspond with your gpu temperature I can help you making it work with that value instead.

jiping-s commented 8 years ago

You can run nvidia-settings to get the current GPU temperature, and then compare it to the figures shown in ec io. Keep monitoring for a few seconds - only a few figures look like temperature (between 50C - 100C => 0x32 - 0x64) and most don't ever change so it should be quick to find out.

danigamba commented 8 years ago

After several attempt i did not find the temperature of the cpu, seems none of them was varying (excluding 0x07 aka CPU Temp) Anyway i can easily read the temperature using nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader or nvidia-settings -q gpucoretemp -t

There's still the problem that only one fan is spinning right now, the other one is fixed at it's minimum, can you help me to how figure out how to understand how to control the second one?

jiping-s commented 8 years ago

Under the current architecture which is entirely in user-space, if the temperature is not directly presented in the EC registers, you'd need to send command sequences in order to read the temperature via the EC. But it'd be rather dangerous as you'd sending command sequences all the time (for querying of temperature), thus increase the chance of conflicts with other programs drastically - let's say program A is sending '1', '2', '3', and program B is sending '4', '5', '6' at the same time, the EC could end up getting '1', '4', '2', '5', '3', '6' which would be totally messed up and at worst case require a cold system reboot. Controlling would be okay since one of the commands sent is the fan number, but without reading the temperature or speed it's not practical.

The command sequences to read and control other CPU fans are both in the ECView.dll, so they're doable. But my suggestion is DO NOT do that (the readings).

catalin852 commented 7 years ago

Ok, today I just realized that my GPU in general is very hot, running at temps almost 90 C. As the title of the post states, only one of the fans is working and the gpu temperature that clevo-indicator is 0 C when I run the command in the terminal, but the tray only shows cpu temp Can somebody give me some advice on this? Either on using clevo-indicator to control it or any other way? My OS is Linux Mint 17.3 Xfce, Model Clevo N150RD laptop, GTX960. I have no idea how it survived until now. I can activate the fans at max with Fn+1 manually. One idea is of course to use Intel HD Graphics, but obviously that is just a temporary solution :P. We do need to play some games.

catalin852 commented 7 years ago

I've run the command to get the EC registers, but it seems I am facing the same issue with @danigamba, can't find the ec entry for gpu temp. Has this issue been solved or a workaround has been found? I did not really get @AqD 's answer about sending command sequences. (plus, I am on Linux, no dll file).

jiping-s commented 7 years ago

Do you have two fans? One dedicated CPU fan and one dedicated GPU fan? My laptop has only one fan connected to CPU and GPU.

All my code on Linux is reversed engineered from the ECView utility (rumors says it's leaked from Clevo) on windows. If you're interested in finding out the port, try to get the original ECView and run it on Windows - see if you can find your GPU fan and control it. (you also need the hotkeys driver installed)

The original ECView.dll contains SetFanDuty(fanNumber, fanSpeed) and GetTempFanDuty(fanNumber). So other fans are configurable (up to 4 fans) - you can check the code here, but I didn't read the assembly code of reading/writing to other fans.

"command sequences" is the official way to query and set fan speed. There are dangerous because you're effectively sending multiple commands in sequence for each operation to specific hardware port, let's say you're sending this to query fan speed:

1 2 3

But other program is also sending 1 2 3, what happens? The hardware port may receive:

1 2 1 2 3 3

See? Not only the two operations would fail, but the EC may be left in a garbage state, and cannot recover until PC resets.

catalin852 commented 7 years ago

Clevo model: N150RD Yes, I have two dedicated fans. Oh, and the gpu fan does kick in automatically, but sometimes when I watch streaming videos, it gets really hot (90C) and the fan does not start automatically. I found the ECView for Windows and I can control the GPU fan. How exactly can I find the EC entry for the GPU using ECView on Windows? Furthermore, on Linux, I am still trying to figure what the temp ec entry is, in case I missed something. The values at d0x00-d0x03 do change, but they do not correspond to the GPU temperature (hexadecimal of course), but to the fan speeds. Now, I have done some observations for c0 and d0 lines. I can tell by now that (based on more experiments):

Observations Both fans at full speed 0000c0 00 00 00 00 00 00 00 00 02 07 34 00 f3 00 ff ff 0000d0 01 eb 01 d3 00 00 00 0f 63 80 05 09 00 07 87 00 Fans at zero speed (no spinning) 0000c0 00 00 00 00 00 00 00 00 02 07 34 00 f2 00 00 00 0000d0 00 00 00 00 00 00 00 0f 63 80 05 09 00 07 87 00 Both fans spinning at some speed 0000c0 00 00 00 00 00 00 00 00 02 07 34 00 f2 00 b2 8d 0000d0 02 ba 04 1f 00 00 00 0f 63 80 05 09 00 07 87 00 Only cpu fan spinning at 100% 0000c0 00 00 00 00 00 00 00 00 02 07 34 00 f2 00 ff 00 0000d0 01 df 00 00 00 00 00 0f 63 80 05 09 00 07 87 00