Closed LethalManBoob closed 1 year ago
Can you please try to build against the current master
version ? This would be version 1.96.0
Also if compiling Linux Kernel and CoreFreq with clang/llvm, check for CONFIG_FORTIFY_SOURCE
fixed in this post
linux-cachyos 6.3.0-5
built with _makemenuconfig=y _use_llvm_lto=full makepkg -sfir
1.96.0
with make CC='clang' LLVM=1 clean all
Good new is it works now but..
Also i seem to be unable to register the cpu idle driver but maybe i followed somthing wrong so if you can drop somthing here to help me that would be appreicated.
Does your kernel log (dmesg
) show any crash ?
Can you validate Processor with CoreFreq +
ArchLinux from Live-CD ? Please take a picture.
Do you still have an issue to start CoreFreq ?
Okay so i was delayed but ill post the dmesg tomorrow.
also the daemon wont start on its own. i have to manually allow it to start every time. I was told it requires me to make a modprobe file that calls for corefreqk to run but thats all i know.
No sign of crash in log above.
Right after booting, starts CoreFreq this way:
make clean all CC='clang' LLVM=1 ## for your CachyOS LTO setup
insmod ./corefreqk.ko
lsmod|grep corefreq ## you should see kernel module of CoreFreq
./corefreq -d ## one thread per CPU is listed
./corefreq-cli
Does it work ?
If not, please reboot to mainline Linux kernel, not CachyOS.
But simply build with gcc
this time:
make clean all CC=gcc
Go back to step 2
rm -f corefreqd corefreq-cli
make -j1 -C /lib/modules/6.3.1-1-cachyos-eevdf-bore-lto/build M=/home/joseph/CoreFreq clean
clang -Wall -Wfatal-errors -pthread -c corefreqd.c \
-D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 \
-o corefreqd.o
clang -Wall -Wfatal-errors -c corefreqm.c \
-D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 \
-o corefreqm.o
clang -Wall -Wfatal-errors corefreqd.c corefreqm.c \
-D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 \
-o corefreqd -lpthread -lm -lrt
clang -Wall -Wfatal-errors -c corefreq-cli.c \
-D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 \
-o corefreq-cli.o
clang -Wall -Wfatal-errors -c corefreq-ui.c \
-D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 \
-o corefreq-ui.o
clang -Wall -Wfatal-errors -c corefreq-cli-rsc.c \
-D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 \
-o corefreq-cli-rsc.o
clang -Wall -Wfatal-errors -c corefreq-cli-json.c \
-D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 \
-o corefreq-cli-json.o
clang -Wall -Wfatal-errors -c corefreq-cli-extra.c \
-D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 \
-o corefreq-cli-extra.o
clang -Wall -Wfatal-errors \
corefreq-cli.c corefreq-ui.c corefreq-cli-rsc.c \
corefreq-cli-json.c corefreq-cli-extra.c \
-D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 \
-o corefreq-cli -lm -lrt
make -j1 -C /lib/modules/6.3.1-1-cachyos-eevdf-bore-lto/build M=/home/joseph/CoreFreq modules
warning: the compiler differs from the one used to build the kernel
The kernel was built by: CachyOS - LLVM 15 BOLT clang version 15.0.7 (https://github.com/llvm/llvm-project.git 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
You are using: clang version 15.0.7
CC [M] /home/joseph/CoreFreq/corefreqk.o
LLVM ERROR: Permission denied: ThinLTO: Can't get a temporary file
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
#0 0x00007f278b9ae15a (/usr/lib/libLLVM-15.so+0xdae15a)
#1 0x00007f278b9ab1df llvm::sys::RunSignalHandlers() (/usr/lib/libLLVM-15.so+0xdab1df)
#2 0x00007f278b9ab32d (/usr/lib/libLLVM-15.so+0xdab32d)
#3 0x00007f278a43e690 (/usr/lib/libc.so.6+0x3e690)
#4 0x00007f278a49900b pthread_kill (/usr/lib/libc.so.6+0x9900b)
#5 0x00007f278a43e5e8 raise (/usr/lib/libc.so.6+0x3e5e8)
#6 0x00007f278a4224f8 abort (/usr/lib/libc.so.6+0x224f8)
#7 0x00007f278b6e3281 (/usr/lib/libLLVM-15.so+0xae3281)
#8 0x00007f278b897e40 LLVMConsumeError (/usr/lib/libLLVM-15.so+0xc97e40)
#9 0x00007f278d65efdf (/usr/lib/libLLVM-15.so+0x2a5efdf)
#10 0x00007f278d65f953 (/usr/lib/libLLVM-15.so+0x2a5f953)
#11 0x00007f278d66041a llvm::lto::thinBackend(llvm::lto::Config const&, unsigned int, std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int)>, llvm::Module&, llvm::ModuleSummaryIndex const&, llvm::StringMap<std::unordered_set<unsigned long, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<unsigned long>>, llvm::MallocAllocator> const&, llvm::DenseMap<unsigned long, llvm::GlobalValueSummary*, llvm::DenseMapInfo<unsigned long, void>, llvm::detail::DenseMapPair<unsigned long, llvm::GlobalValueSummary*>> const&, llvm::MapVector<llvm::StringRef, llvm::BitcodeModule, llvm::DenseMap<llvm::StringRef, unsigned int, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, unsigned int>>, std::vector<std::pair<llvm::StringRef, llvm::BitcodeModule>, std::allocator<std::pair<llvm::StringRef, llvm::BitcodeModule>>>>*, std::vector<unsigned char, std::allocator<unsigned char>> const&) (/usr/lib/libLLVM-15.so+0x2a6041a)
#12 0x00007f278d63b40b (/usr/lib/libLLVM-15.so+0x2a3b40b)
#13 0x00007f278d651570 (/usr/lib/libLLVM-15.so+0x2a51570)
#14 0x00007f278bf7c60a (/usr/lib/libLLVM-15.so+0x137c60a)
#15 0x00007f278b92052d llvm::ThreadPool::processTasks(llvm::ThreadPoolTaskGroup*) (/usr/lib/libLLVM-15.so+0xd2052d)
#16 0x00007f278b920f25 (/usr/lib/libLLVM-15.so+0xd20f25)
#17 0x00007f278a49708f (/usr/lib/libc.so.6+0x9708f)
#18 0x00007f278a5294b0 (/usr/lib/libc.so.6+0x1294b0)
make[2]: *** [scripts/Makefile.build:252: /home/joseph/CoreFreq/corefreqk.o] Error 134
make[2]: *** Deleting file '/home/joseph/CoreFreq/corefreqk.o'
make[1]: *** [Makefile:2023: /home/joseph/CoreFreq] Error 2
make: *** [Makefile:86: all] Error 2
Please see https://github.com/cyring/CoreFreq/issues/435#issuecomment-1528312632 how CachyOS is built
Look like a high change that lto now breaks it. the corefreq-cli works when build from source
okay so when i install from aur...
corefreq-ro-shm: 'No such file or directory' @ line 21331```
cachyo
AUR is built with these options:
_makenconfig=1 _use_llvm_lto=thin _cpusched=cachyos makepkg -cCsfir
CONFIG_FORTIFY_SOURCE
is disabled as shown in https://github.com/cyring/CoreFreq/issues/435#issuecomment-1525767008
Now building with make clean all CC='clang' LLVM=1
Same bug as yours
LLVM ERROR: Permission denied
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
...
Now building with no LTO
_makenconfig=1 _use_llvm_lto=none _cpusched=cachyos makepkg -cCsfir
Now building with no LTO
_makenconfig=1 _use_llvm_lto=none _cpusched=cachyos makepkg -cCsfir
Booting:
Linux version 6.3.1-1-cachyos (linux-cachyos@cachyos) (gcc (GCC) 13.1.1 20230429, GNU ld (GNU Binutils) 2.40.0)
...
Command line: initrd=\EFI\Linux\amd-ucode.img initrd=\EFI\Linux\initramfs-linux-cachyos.img
Building:
make clean all ## GGC forced used because no LTO
...
make -j1 -C /lib/modules/6.3.1-1-cachyos/build M=/xxx/CoreFreq modules
CC [M] /xxx/CoreFreq/corefreqk.o
MODPOST /xxx/CoreFreq/Module.symvers
CC [M] /xxx/CoreFreq/corefreqk.mod.o
LD [M] /xxx/CoreFreq/corefreqk.ko
BTF [M] /xxx/CoreFreq/corefreqk.ko
Starting:
insmod /xxx/CoreFreq/corefreqk.ko
/xxx/CoreFreq/corefreqd -d
CoreFreq Daemon 1.96.1 Copyright (C) 2015-2023 CYRIL COURTIAT
Processor [AMD Ryzen 9 3950X 16-Core Processor]
Architecture [Zen2/Matisse] 32/32 CPU Online.
SleepInterval(1000), SysGate(2000), 2335 tasks
CPU #000 @ 3499.79 MHz
...
Btw:
zgrep CONFIG_FORTIFY_SOURCE /proc/config.gz
# CONFIG_FORTIFY_SOURCE is not set
Now configuring full LTO
_makenconfig=1 _use_llvm_lto=full _cpusched=cachyos makepkg -cCsfir
Booting:
Linux version 6.3.1-1-cachyos-lto (linux-cachyos-lto@cachyos) (clang version 15.0.7, LLD 15.0.7) #1 SMP PREEMPT_DYNAMIC Sat, 06 May 2023 03:15:57 +0000
Command line: initrd=\EFI\Linux\amd-ucode.img initrd=\EFI\Linux\initramfs-linux-cachyos-lto.img
...
Building & running CoreFreq
make clean all CC='clang' LLVM=1
insmod /xxx/CoreFreq/corefreqk.ko
/xxx/CoreFreq/corefreqd -d
CoreFreq Daemon 1.96.1 Copyright (C) 2015-2023 CYRIL COURTIAT
Processor [AMD Ryzen 9 3950X 16-Core Processor]
Architecture [Zen2/Matisse] 32/32 CPU Online.
SleepInterval(1000), SysGate(2000), 2335 tasks
CPU #000 @ 3499.82 MHz
...
I am currently on the non lto version but it still gives me the error I said above when trying corefreq-cli
I am currently on the non lto version but it still gives me the error I said above when trying corefreq-cli
Based on https://github.com/cyring/CoreFreq/issues/435#issuecomment-1536767686 and https://github.com/cyring/CoreFreq/issues/435#issuecomment-1536772520 it's hard to imagine what's going on your system.
There's only one way to make CoreFreq works; It has to successfully startup in that order:
So I would like you to run CoreFreq with the mainstream Linux kernel and gcc ; no CachyOS flavor of whatever, no patch. Please let me know if it successfully starts and we can validate first there is no hardware issue to support your processor. Thank you.
Hello, Did you make the test requested above ?
Ill test this after work
DKMS make.log for corefreq-1.95.5.r0.g34efe5d for kernel 6.3.0-4-cachyos-lto (x86_64)