You are not logged in.
Hello everyone! After upgrading to KDE 6, I was surprised that Wayland works much better than X11. But after switching to Wayland, many problems surfaced, most of which were resolved. One unresolved issue is fan control on the Nvidia graphics card. I found a bash script that adjusts the speed using
/usr/bin/nvidia-settings -a "*:1[gpu:0]/GPUFanControlState=1" -a "*:1[fan-0]/GPUTargetFanSpeed=$1" -a "*:1[fan-1 ]/GPUTargetFanSpeed=$1"When started manually everything works as it should, but I need it to start automatically. And this is where the problems begin. It turns out nvidia-settings cannot change settings until any window server is running. And I run the script in the root environment via systemctl. I tried to create a temporary session via xhost si:localuser:root, but it gives me the error xhost: unable to open display "0". And I don't quite understand how to solve this problem. I wanted to consider the option of controlling fans using some library from the code, but so far I haven’t found anything. Can you share your thoughts on this? Has anyone encountered this?
Last edited by Afmer (2024-03-15 19:34:24)
Offline
** Message Deleted **
Last edited by onemyndseye (2024-03-20 17:52:08)
Offline
Easiest fix that comes to mind is create a startup script in ~/bin/apply-nvidia-settings.sh and autostart it with your KDE login.
~/bin/apply-nvidia-settings.sh
#!/bin/bash # Change this SPEED=X /usr/bin/nvidia-settings -a "*:1[gpu:0]/GPUFanControlState=1" -a "*:1[fan-0]/GPUTargetFanSpeed=$SPEED" -a "*:1[fan-1 ]/GPUTargetFanSpeed=$SPEED"save and exit then:
chmod +x ~/bin/apply-nvidia-settings.shThen open KDE Settings and search for "autostart" Click "Add application" and browse to ~/bin and select the script you just made. Click OK then apply. Then logout and log back in - Your default setting set with $SPEED at the top of the script should be applied.
For automatic fans something like this should do:
~/bin/fanspeedd.sh
#!/bin/bash do_fan_speed() { SPEED=$1 /usr/bin/nvidia-settings -a "*:1[gpu:0]/GPUFanControlState=1" -a "*:1[fan-0]/GPUTargetFanSpeed=$SPEED" -a "*:1[fan-1 ]/GPUTargetFanSpeed=$SPEED" } while [ 1 ]; do cpu_temp="$(sensors -f |grep temp1 |awk '{print $2}' |sed '{s|+||g;s|\.| |g}'|awk '{print $1}')" # These values in F # Change the values to the fan speeds you wish [ "$cpu_temp" -gt 1 ] && SPEED=#LOW VALUE# [ "$cpu_temp" -gt 150 ] && SPEED=#MED VALUE# [ "$cpu_temp" -gt 180 ] && SPEED=#HIGH_VALUE# do_fan_speed $SPEED sleep 1 doneWARNING::: This code is written off the top of my head and is UNTESTED!
Hope this helps!
This is a good solution, but there is one problem. /usr/bin/nvidia-settings should be launched via sudo
Offline
** Message Deleted **
Last edited by onemyndseye (2024-03-20 17:53:00)
Offline
** Message Deleted **
Last edited by onemyndseye (2024-03-20 17:52:31)
Offline
well damn lol ..
OK Since it must be started after the desktop the only thing I can think for you to do is give yourself NOPASSWD access to /usr/bin/nvidia-setttings in /etc/sudoers
edit /etc/sudoers as root and add the following line
YourUserName ALL = (root) NOPASSWD: /usr/bin/nvidia-settingsThis will allow you passwordless sudo access to /usr/bin/nvidia-settings. change the code above to add the sudo command to the do_fan_speed() function
I made a script that controls nvidia-settings and added it to sudoers in NOPASSWD. I made a service in systemctl and it works. But I just had to add a 10 second delay to the service. Thank you very much for the idea!!!
Offline
Hello everyone! After upgrading to KDE 6, I was surprised that Wayland works much better than X11.
not directly related to your question but in what sense do you mean that it works better than x11? do you get more FPSs in games? i´m actually observing quite the opposite, a significant performance degradation in wayland (never had less than 50 fps in WoW on kde5/x11 , and with wayland there are times where i get only 20)
sorry for the offtopic, hope itś not an issue
cheers
Offline
Afmer wrote:Hello everyone! After upgrading to KDE 6, I was surprised that Wayland works much better than X11.
not directly related to your question but in what sense do you mean that it works better than x11? do you get more FPSs in games? i´m actually observing quite the opposite, a significant performance degradation in wayland (never had less than 50 fps in WoW on kde5/x11 , and with wayland there are times where i get only 20)
sorry for the offtopic, hope itś not an issue
cheers
Well, personally, in my case, the desktop runs much faster on Wayland. Opening windows, turning on the PC, animations. On x11, while I have Steam loading, my desktop runs at about 15 fps. I don't have this on Wayland. Some program windows open much faster on Wayland than on X11. I haven't done any tests regarding games. What I play worked at 60 fps, and still works. My PC turns on much faster with Wayland than with X11
Possibly due to the fact that I have a new KDE 6.
It’s also worth noting that the telegram client on Wayland opens instantly for me. On X11 it takes about a minute to open
Last edited by Afmer (2024-03-16 13:51:34)
Offline