rog-fan-curve --fan=cpu/gpu --get returns error
Closed this issue · 10 comments
Config:
- ASUS ROG Strix SCAR G732LWS (I7 10875H, RTX 2070 SUPER);
- System: Artix Linux dinit with 6.7.8.zen1-1 kernel;
Issue description:
Executing rog-fan-curve --fan=cpu/gpu --get
gives:
ERROR: unable to connect to rog-daemon, is it running?
Meanwhile everything else works perfectly.
Sorry for noticing here, but awsome job with this tool. This is way better than asusctl, the best thing for asus laptops. And it is written in C++ so I appreciate it even more. Of course, I've already voted for it on AUR. Thank you.
That's really weird. Are you sure you've set up the dinit service correctly? Try stopping the service, start the daemon from command line with sudo rog-daemon
and check if problem is gone.
Here is dinit service:
type = process
command = /usr/bin/rog-daemon
smooth-recovery = true
restart = true
depends-on = dbus
Launching the daemon using just doas rog-daemon
and then using rog-fan-curve --fan=cpu/gpu --get
gives
/usr/include/c++/13.2.1/array:202: constexpr std::array<_Tp, _Nm>::value_type& std::array<_Tp, _Nm>::operator[](size_type) [with _Tp = int; long unsigned int _Nm = 8; reference = int&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
Looks like undefined behaviour that doesn't cause issues on my system. I'll try debugging it with sanitizers soon.
I can't reproduce it even with sanitizers. Can you try compiling it with sanitizers yourself? You need clang and LLVM to be installed on your system. Clean the build directory and build with following commands:
export CXX=clang++
export CXXFLAGS=-fsanitize=address,leak,undefined
export LDFLAGS=-fsanitize=address,leak,undefined
meson setup build && cd build
meson compile
sudo meson install
I was building it using gcc and gcc's libstdc++ as you can see in the error from message above /usr/include/c++/13.2.1/array:202
(gcc version is there too in addition). I think, you do not need sanitizers to check this. Just try to use libstdc++ instead of llvm's libc++, however it will be better to reproduce this with full gcc toolchain. I thought it was supposed to use gcc, because you have listed base-devel package in your dependencies.
Yes, it is supposed to be built with gcc, but it is rather my bug than libc's, and clang has nice tools for debugging undefined behavior. Anyway, can you please share config files in /etc/rog-daemon
folder? Maybe it will help reproducing the issue.
There are only the following files:
- fan_curve_1_0:
1
0 65 67 70 75 80 85 90
0 0 0 25 25 38 38 51
- fan_curve_1_1:
1
0 65 67 70 75 80 85 90
0 0 0 25 25 38 38 51
I assume this information won't help you in any way.
I think you should try to look at (step by step debug, maybe static linking libstdc++ if your debugger requires this) the assertion causing issue, which is, according to the error message above, is at line 202 in array file of libstdc++ version 13.2.1. Excuse me, please, for those explicit instructions. I am sure you know how to do this yourself, I was just pointing on it to give you my assumptions on this issue.
I think this commit should fix the bug: 53f2f62.
Yes, you are right. Now result is the following:
> rog-fan-curve --fan=cpu --get
Enabled
0c:0%,65c:0%,67c:0%,70c:9%,75c:9%,80c:14%,85c:14%,90c:20%
and
> rog-fan-curve --fan=gpu --get
Enabled
0c:0%,65c:0%,67c:0%,70c:9%,75c:9%,80c:14%,85c:14%,90c:20%
Thank you very much. And I want to emphasize this again, your project just kills asusctl and supergfxctl. Every asus laptop user with linux or bsd must know about this piece of software.