nan0s7 / nfancurve

A small and lightweight POSIX script for using a custom fan curve in Linux for those with an Nvidia GPU.
GNU General Public License v3.0
315 stars 58 forks source link

Only first change works #8

Closed dscarmo closed 5 years ago

dscarmo commented 5 years ago

Hello!

I am trying to use your script with cool-bit 4, and after the first change of fan speed no more changes are done. The script keeps running and reporting what should be the current fanspeed but it is not changed.

Any idea of why?

Using ubuntu 18 with a 1060, running 390.77 driver

nan0s7 commented 5 years ago

Hmm I'm not sure, I'd need more information. You can try changing the fan speed manually, which will help determine if it's a problem with what the script is doing or something with your setup.

You can monitor the status of the GPU by typing watch nvidia-settings.

Enable fan control: nvidia-settings -a [gpu:0]/GPUFanControlState=1 Set fan speed: nvidia-settings -a [gpu:0]/GPUTargetFanSpeed=30 (you can change the "30")

Please let me know what those commands say, if they say anything. Also test what you get when you try to retrieve the number of fans, gpus and temperature of the card.

Current temperature: nvidia-settings -q=[gpu:0]/GPUCoreTemp -t Fan number: nvidia-settings -q fans GPU number: nvidia-settings -q gpus

When you're done, you can set the fan control state back to zero: nvidia-settings -a [gpu:0]/GPUFanControlState=0

Let me know what you get, and we can figure this out :)

dscarmo commented 5 years ago

When i execute nvidia-settings -a [gpu:0]/GPUTargetFanSpeed=30 there is no change in speed. Tried with sudo too.

But sometimes there is. Trying to find why. The GPU number is correct (gpu:0)

nan0s7 commented 5 years ago

You don't have to run these commands with sudo so that should be fine. Did you make sure to enable the fan control with the command I mentioned before trying to change the fan speed? Also, was there anything else that came up when you tried to change the fan speed? Like any errors or something else? If not, that means there isn't anything "wrong".

EDIT: Just warning you that if you haven't set up Coolbits correctly and then update the nvidia drivers, Coolbits may have been set back to zero - meaning that you can't control the fan speed.

dscarmo commented 5 years ago

If you read what i commented before about screen, forget it, i found an error now After the first fanspeed change, when i raise my gpu temperature and the script attempts to change fan speed again, the following appears on the output:

/xxx/xxx/xxx/nfancurve/temp.sh: linha 184: [: : esperava expressão de número inteiro (translation: line 184: expected integer number expression)

I didnt see before cause it was mixed with all the other INFO logs

I am using /bin/bash from ubuntu 18.04 GPU power level and fan commands work correctly, so i think coolbits is working

nan0s7 commented 5 years ago

Yeah I saw what you said about screen and the command you use looks perfectly fine and should work (although if there is some sort of conflict it'd be good to know, too :D ).

Hmm I'm assuming you're using the latest git version? If so, 184 is the line that compares the new speed with what the speed would have been for the last update. I just made a minor tweak that may help fix that particular line so if you can try the latest git version that'd be good.

I'm assuming since you're using /bin/bash to run the script, that you're using another shell by default? Can I ask which shell it is you're using? It could potentially be some sort of compatability issue.

Anyway, thanks for being patient while we figure this out.

dscarmo commented 5 years ago

The fix you mentioned in last comment wasnt enough, but i tried again today seeing you updated more stuff and it seems to be working. I will use it today and close this issue if no more problems appear!

Thanks for the support!

As a suggestion, I think it would be nice if the log had what was the last speed change made. Sometimes its confusing with the cooldowns, expected fan speed being different from what is going at the moment

nan0s7 commented 5 years ago

Oh that's pretty interesting; I wonder what actually fixed the issue xD

Well I'm glad it seems to be working now. Let me know if anything else happens in the future! And thanks for the suggestion! I'll make sure to add that to the log in the morning sometime.

I'm just happy we were able to get it working for you! Hope it serves you well :D

dscarmo commented 5 years ago

Unfortunately, after some time working, i got the same error message (about expecting integer) this time on line 144.

I didnt say that before, but i do use two monitors, do you think that may be why?

nan0s7 commented 5 years ago

Alrighty I think I fixed the bug you've been experiencing, and I've updated the logging to be more useful.

I was considering removing the line where it compares the proposed new speed to the old speed, as I'm not sure how useful it actually is. But I'll keep it in for now.

Nah it wouldn't affect the script. Plus, I use two monitors as well! :D

dscarmo commented 5 years ago

Seems to be fixed for real now! Thanks!