Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
RPI4 performance issues with 6.1 kernel
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
JumboAg
Apprentice
Apprentice


Joined: 03 Mar 2007
Posts: 205
Location: Dallas, TX

PostPosted: Wed Oct 18, 2023 12:30 am    Post subject: RPI4 performance issues with 6.1 kernel Reply with quote

Is anyone running Gentoo on a raspberry pi 4b (8G)? If so, hows performance for you? My new install isn't really even usable. Standalone terminal stuff is fine but I installed lxde and the firefox browser is extremely slow (cant compile chromium). Playing video stutters so bad its impossible to view.

I think I have everything installed correctly but am welcome to ideas on what to check. Its night and day comparing this to a stock raspbian install. That one runs very fast on the same RPI4.

Code:
$ uname -a
Linux hamtoopi 6.1.54-v8+ #1 SMP PREEMPT Wed Oct  4 01:01:34 CDT 2023 aarch64 GNU/Linux


Code:
$ cat /boot/config.txt
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

# Automatically load overlays for detected cameras
camera_auto_detect=1

# Automatically load overlays for detected DSI displays
display_auto_detect=1

# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
max_framebuffers=2

# Run in 64-bit mode
arm_64bit=1

# Disable compensation for displays with overscan
disable_overscan=1

[cm4]
# Enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
otg_mode=1

[all]

[pi4]
# Run as fast as firmware / board allows
arm_boost=1

[all]
gpu_mem=256
over_voltage=6
arm_freq=2000
gpu_freq=750


Code:
$ glxinfo -B
name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Broadcom (0x14e4)
    Device: V3D 4.2 (0xffffffff)
    Version: 23.1.8
    Accelerated: yes
    Video memory: 7635MB
    Unified memory: yes
    Preferred profile: compat (0x2)
    Max core profile version: 0.0
    Max compat profile version: 2.1
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.1
OpenGL vendor string: Broadcom
OpenGL renderer string: V3D 4.2
OpenGL version string: 2.1 Mesa 23.1.8
OpenGL shading language version string: 1.20

OpenGL ES profile version string: OpenGL ES 3.1 Mesa 23.1.8
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3916

PostPosted: Wed Oct 18, 2023 2:31 pm    Post subject: Reply with quote

You can not expect it to be like a laptop but in my case it is fairly ok.
I use same rpi4 like yours.
Some config of mine
Code:

VIDEO_CARDS="vc4 v3d"

Code:

USE="............ egl gles1 gles2 opengl"

Code:

arm_64bit=1
kernel=kernel8.img
initramfs initramfs-6.1.38-v8+.img
disable_overscan=1
gpu_mem=128
dtparam=audio=on
enable_uart=0
dtoverlay=disable-wifi
dtoverlay=disable-bt
disable_splash=1
[pi4]
dtoverlay=vc4-fkms-v3d
max_framebuffers=2
[all]
over_voltage=6
arm_freq=2000


As for kernel I always use
https://github.com/raspberrypi/firmware
for my kernels.
Also I only keep my /boot parition on the SD card.
All other partitions I rsynced to a mini SSD drive and I use that instead of the SD card.
_________________
:)
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54577
Location: 56N 3W

PostPosted: Wed Oct 18, 2023 4:24 pm    Post subject: Reply with quote

JumboAg,

Check the CPU governor in use.

Code:
Default CPUFreq governor (powersave)  --->
is a bad choice.

There are some /proc or /sys entries to read and write to change it on the fly, as long as the governor you want is already built.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
gentoo_ram
Guru
Guru


Joined: 25 Oct 2007
Posts: 501
Location: San Diego, California USA

PostPosted: Wed Oct 18, 2023 10:43 pm    Post subject: Reply with quote

I agree that the default CPU governor is "powersave" which makes the device run at 600MHz all the time. It took me a while to figure that out. I wondered why my Pi4B felt so slow!

I added a /etc/local.d/cpugovern.start:
Code:
#!/bin/bash

echo 'ondemand' > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 'ondemand' > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo 'ondemand' > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo 'ondemand' > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor


After that, it was much better. I wrote a script to report how much time is spent at all the different frequencies. It's a little verbose, but works for me:

Code:
#!/usr/bin/perl -w

# Read which processors are available
open L, "/sys/devices/system/cpu/online" or die "can't open online CPU list";
$l = <L>;
close L;
if ($l =~ /(\d+)-(\d+)/)
{
        $min_cpu = $1;
        $max_cpu = $2;
}
else
{
        die "can't parse CPU list";
}

# read the data for the first processor
open C, "/sys/devices/system/cpu/cpu${min_cpu}/cpufreq/scaling_cur_freq" or die "Can't open CPU frequency stats";
@c = <C>;
close C;
chomp @c;
$curr_freq_list[0] = $c[0];

open F, "/sys/devices/system/cpu/cpu${min_cpu}/cpufreq/stats/time_in_state" or die "can't open stats file";
@f = <F>;
close F;
chomp @f;

# Set up the per-processor clocking stats
$f{0} = [ ];

foreach $_ (@f)
{
        @s = split / /;
        $f{$s[0]} = [ $s[1] ];
        $f{0}[0] += $s[1];
}

# Go through the rest of the processors and collect the stats
for ($cpu = $min_cpu+1; $cpu <= $max_cpu; $cpu++)
{
        open C, "/sys/devices/system/cpu/cpu${cpu}/cpufreq/scaling_cur_freq" or die "can't open curr file";
        @c = <C>;
        close C;
        chomp @c;
        push @curr_freq_list, $c[0];

        open F, "/sys/devices/system/cpu/cpu${cpu}/cpufreq/stats/time_in_state" or die "can't open stats file";
        @f = <F>;
        close F;
        chomp @f;

        foreach $_ (@f)
        {
                @s = split / /;
                $ff=int $s[0];
                $tt=int $s[1];
                push @{$f{$ff}}, $tt;
                $f{0}[$cpu] += $tt;
        }

}

# Print the output...
print "CPU:\t";
for ($cpu = $min_cpu; $cpu <= $max_cpu; $cpu++)
{
        printf "%5d\t", $cpu;
}
print "\n";

print "Curr:\t";
for ($cpu = $min_cpu; $cpu <= $max_cpu; $cpu++)
{
        printf "%6.2f\t", $curr_freq_list[$cpu]/1000000;
}
print "\n";

foreach $_ (sort {$a <=> $b} keys %f)
{
        next if ($_ == 0);

        printf ("%4.2f\t", $_/1000000);

        for ($cpu = $min_cpu; $cpu <= $max_cpu; $cpu++)
        {
                printf "%6.2f%%\t",
                        $f{$_}[$cpu] / $f{0}[$cpu] * 100.0;
#               printf "%10d (%5.1f%%)\t",
#                       $f{$_}[$cpu],
#                       $f{$_}[$cpu] / $f{0}[$cpu] * 100.0;
        }

        print "\n";
}


Output:
Code:
CPU:        0       1       2       3   
Curr:     1.60    1.60    1.60    1.60 
0.60     92.64%  92.64%  92.64%  92.64%
0.70      5.33%   5.33%   5.33%   5.33%
0.80      0.75%   0.75%   0.75%   0.75%
0.90      0.16%   0.16%   0.16%   0.16%
1.00      0.08%   0.08%   0.08%   0.08%
1.10      0.08%   0.08%   0.08%   0.08%
1.20      0.09%   0.09%   0.09%   0.09%
1.30      0.06%   0.06%   0.06%   0.06%
1.40      0.04%   0.04%   0.04%   0.04%
1.50      0.05%   0.05%   0.05%   0.05%
1.60      0.03%   0.03%   0.03%   0.03%
1.70      0.02%   0.02%   0.02%   0.02%
1.80      0.67%   0.67%   0.67%   0.67%
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM 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