Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] nvidia-settings lost ability to control gpu fan
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
jagdpanther
l33t
l33t


Joined: 22 Nov 2003
Posts: 729

PostPosted: Wed Aug 04, 2021 3:54 am    Post subject: [SOLVED] nvidia-settings lost ability to control gpu fan Reply with quote

Sometime over the last two days nvidia-settings has lost the ability on my Gentoo system to control my nvidia GPU fan.

When using the nvidia-settings GUI, and trying to set the GPU fan speed manually after selecting the "Thermal Settings" -> Enable GPU Fan Settings check box and then moving the fan speed selector to the right and pressing "Apply" I receive a little message: "Failed to set new Fan Speed!".

If I try to set the fan speed on the command line I receive:
Code:
$ nvidia-settings -a "GPUTargetFanSpeed=40"


ERROR: Error assigning value 40 to attribute 'GPUTargetFanSpeed' (runner:0[fan:0]) as specified in
       assignment 'GPUTargetFanSpeed=40' (Unknown Error).


I tried updating from the "stable" x11-drivers/nvidia-drivers-460.91.03 to nvidia-drivers-470.57.02. This did not help.

I see that there are other (non-Gentoo) linux users with a similar issues.

https://forum.manjaro.org/t/nvidia-460-73-01-doesnt-allow-changing-fan-speeds/64961 and
https://forums.developer.nvidia.com/t/465-24-02-no-longer-able-to-set-graphics-clock-offset-and-memory-transfer-rate-offset/175640

Any suggestions on regaining control of my Nvidia GPU fan would be greatly appreciated.


Last edited by jagdpanther on Thu Aug 05, 2021 2:25 am; edited 1 time in total
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2719

PostPosted: Wed Aug 04, 2021 5:17 am    Post subject: Reply with quote

They introduced this as part of a security fix for bug #784596 and then backported the issue to every branch (i.e. even 390.xx is affected). I held back stabilizing despite that for a while because of this but after 3 months and several new versions (and also a new security bug) they still haven't done a thing about it so had to move on (that was sometime around 2 weeks ago), unsure how long we'll be stuck with this.

If you want this to work anyway, it's not great but the workaround is to emerge xorg-server with USE="suid -elogind -systemd"

Or alternatively, use a display manager that still starts Xorg as root, like sddm.

For Gentoo, this is tracked in bug #784248 (not that there's much to see there).

Edit: the ebuild also somewhat warn about it, but the message is very selective, aka only if it detects Coolbits usage and only once not to spread suid use too much (possibly to users that don't even use Coolbits, most don't). So possibly it was never displayed for you, assuming didn't just miss it alongside a large world upgrade (felt it wasn't worth a news item).
Back to top
View user's profile Send private message
jagdpanther
l33t
l33t


Joined: 22 Nov 2003
Posts: 729

PostPosted: Wed Aug 04, 2021 5:32 pm    Post subject: Reply with quote

Ionen: Thank you for the informative reply.

I have used Coolbits for years (and still have it set). I have been using a small, slightly modified python script that someone at Google wrote years ago to control the fan speed of my EVGA gtx 1070. I don't need the fan control for most things, but do like graphic intensive (steam) games on occasion and want that GPU fan control.

I don't use a display manager, just a window manager. I log into the console and then 'exec startx' to get openbox up and running.
I think I'll try changing the use flags for xorg-server. I should only need to change one use flag as systemd is already off (I don't use systemd) and suid is set (needed for startx).
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2719

PostPosted: Wed Aug 04, 2021 6:01 pm    Post subject: Reply with quote

Yes, "suid elogind" has a bit different meaning than "suid -elogind". If already had suid, then it /should/ work if just disable elogind (not that I tried with startx).

On a related note, nvidia-drivers-470.57.02 enables Coolbits 4 by default allowing fan control without custom Xorg configs.. but still affected by this issue either way.

I use my own tiny fan control daemon I wrote in C, but been thinking to add this to the tree for a proper one:
https://github.com/foucault/nvfancontrol

Sadly delayed the idea while waiting for potentially fixed drivers hoping not to have to recommend people to run Xorg as root.
Back to top
View user's profile Send private message
jagdpanther
l33t
l33t


Joined: 22 Nov 2003
Posts: 729

PostPosted: Thu Aug 05, 2021 2:24 am    Post subject: Reply with quote

nvidia-settings (both GUI and CLI) now can control my Nvidia GPU fans again. Thanks Ionen. The use flags you mention work like a champ:
Quote:
If you want this to work anyway, it's not great but the workaround is to emerge xorg-server with USE="suid -elogind -systemd"


X and nvidia fan control work fine using startx to initiate my xwindows manager.

Here are the use flags I am currently using in xorg-server:
Code:
     Installed versions:  Version:   1.20.11(0/1.20.11)^t
                          Date:      06:45:31 PM 08/04/2021
                          USE:       ipv6 suid udev wayland xorg -debug -dmx -doc -elogind -kdrive -minimal -selinux -systemd -test -unwind -xcsecurity -xephyr -xnest -xvfb
Back to top
View user's profile Send private message
Massaker
n00b
n00b


Joined: 14 Apr 2005
Posts: 23

PostPosted: Thu Mar 31, 2022 2:40 pm    Post subject: Reply with quote

omg yes! thank you! I spent way too long trying to control my stupid GPU fans... and it all had to do with Nvidia being weird about root starting X.

I don't care I'm posting in a thread that's a year old, this information was gold. Here are some search terms maybe search engines will pick up.

    can't set nvdia fan speed in linux
    nvidia gpu fans don't work in linux
    can't control 2080ti gpu fan in gentoo
    coolbits doesn't let me control fan speed
    nvidia-settings error setting fan
    crypto mining linux set nvdia fan speed

Code:
su #enter root
USE="suid -elogind -systemd" emerge -a xorg-server
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2719

PostPosted: Thu Mar 31, 2022 3:16 pm    Post subject: Reply with quote

Yes, this is unfortunately still relevant :(

I try it sometimes to see if fixed and people been bugging nvidia about it for a while but still doesn't work without root/cap_sys_admin and no news. They apparently have some internal bug open about it but there's no public access to tell what's going on.

USE="suid -elogind -systemd" is indeed still what I suggest if need Coolbits and display manager isn't starting it as root (sddm still does, but believe that's going to change), haven't found non-root workarounds.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum