-
Notifications
You must be signed in to change notification settings - Fork 1.7k
firmware in Bookworm repo results in degraded performance #1705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
That's not our image, kernel or firmware package. |
It is the firmware distributed by this site; I am the Debian maintainer for it. The kernel is, yes, an upstream kernel. |
Ah alright, I'm not seeing anything obvious in the packaging that may have had an effect, so if the only difference is the firmware change, then it sounds like it could be a legitimate issue. At first I thought maybe this change may have generated a significantly different config.txt, but no, that looks okay. https://salsa.debian.org/debian/raspi-firmware/-/commit/6ee3ca756fe369fdb961b04de900fe0ba12afb29#94dc7bd91c09e1a4aaa1a84a29e4657f3aefb44a_110_110 |
I'm not seeing a difference in Raspberry Pi OS with just a firmware change:
|
@XECDesign what happens if you run @HankB reported on Debian channels earlier this:
That's not good and seems to be the reason that the CPU operated at the lowest frequencies ... thus resulting in lower scores then one would otherwise get. There was also a mention of #1619 which could be related (even though the last message indicates the problem has been fixed)? |
|
I really appreciate the attention this has gotten. I don't expect the Raspberry Pi devs to go beyond confirming that the problem does not manifest with the Raspberry Pi OS. Nevertheless, I appreciate any further suggestions on how I can help to track this down. I have installations of R Pi OS (both 32 and 64 bit) that I can compare to as well as a Debian Bullseye install that does not demonstrate this problem. I have an extra SSD (or two) that I can use for testing so as not to risk the systems I use on a regular basis so nothing is off the table as far as experimentation goes. I have gotten further direction from Diederik de Haas and welcome any other thoughts. |
We can leave this open for now. |
I have determined that |
It's probably worth disabling any over-clocking options and running using "vcgencmd get_throttled" to see if it's hitting thermal issues https://www.raspberrypi.com/documentation/computers/os.html#get_throttled Running the bcmstat tool https://github.com/MilhouseVH/bcmstat in the background might highlight some differences in system behaviour CPU / temp. |
The RPi userland programs like It's worth noting that 'degraded performance' is an understatement. Before I knew what it entailed, my first guess was something like throttling too. But the (CPU) performance is WAY less then HALF of what it should be. What I asked @HankB to do is a procedure similar to The reason I think/though #1619 could be related is because it appears to me that clock values are often used to multiply of divide with to set/determine speeds and if those values are 0 you get either 0 as result or an illegal operation which should get caught and could then also result in a 0 return value. But how clocks really work is 'above my pay grade', so it could be entirely unrelated. |
Hi Tim, thanks for the suggestions. I discovered the situation when performing some benchmarks to establish baseline numbers before attempting overclocking. And in this case Debian Liunux still clocks the processor at 1.5GHz (when things are operating as intended.) When the problem manifests, the processor clock seems not to be available by any normal means and I suspect the processor is running at a default power up frequency. I have the two Pi 4Bs used for testing installed in Flirc cases which cool the processor extremely well. It takes about 15 minutes of run time with a long running stress test just to get the processor to about 60°C, no where near the temperature that would result in throttling. |
If the vcmailbox interface has stopped then it's possible that it's stuck at some frequency, although I'd expect errors in dmesg about rpi_firmware_transaction failures. The vcmailbox rpi-userland program doesn't depend on VCHIQ so might be able to download just that binary and run that This allows you to poke the MEASURE_CLOCK mailbox directly e.g.
The other thing to check is /proc/meminfo in-case the size of CMA carveouts has changed. On Raspberry Pi OS Bullseye the 2GB+ models have a larger CMA region in order to support mutter. |
64 bit R-Pi OS
64 bit Debian Buster
64 bit Debian Bookworm (with working
64 bit Debian Bookworm (with trouble
I'm not familiar with the CMA region and have no idea if these numbers mean anything. Thank you, |
Does running vcmailbox with sudo help? |
In the example above I was running |
I'd guess that kernel wasn't built with |
No. I found |
I've installed debian and manually updated firmware to latest and after a reboot I see:
I was expecting that to fail (i.e. return nothing or a single frequency) You can download latest firmware here: replace the ones in /boot/firmware (or first partition if updating on another machine). Note: most debugging tools don't work with the upstream kernel. The vcdbg from here does. |
To explain your vcmailbox failure, the upstream kernels are lacking vcio, which is the userspace ioctl shim to the mailbox interface. That shouldn't affect the use by kernel drivers such as the clock driver, but it does prevent you from prodding the VPU for diagnostic purposes. |
Ah - I just tried this version: which looks to have the failure reported:
Possibly it is an issue with Jan 20 firmware that is not present with latest version. |
What is confusing to me is that @HankB tested the 1.20220308 release and concluded it to be bad. Hank, could you test every tagged version between 1.20211118 and 1.20220308 and post the results in a table as a reply to this issue? Like you did earlier, but do make the dates sequential now. And then also try it from master. |
I've bisected on our internal firmware tree and identified the commit where it was fixed: That entered the firmware source tree on Jan 24 2022 and a firmware build was pushed to master branch of raspberrypi/firmware on the same day. It's not currently on the stable tree. |
This is effectively a duplicate of #1688. |
I've repeated testing firmware including some not previously tested and also the "latest" start4.elf,fixup4.dat which was installed on top of the firmware manually copied from the test procedure (1.20220308) on top of the firmware that installs with the latest bookworm upgrade (.
(*) Starts to boot, screen goes blank (which is normal I think) and then looks like like random data written to screen buffer. I repeated the test with the "latest" on top of the 1.20211118 with the same result. (I'm not sure at this point what firmware is original on the bookworm image as the install which I did not upgrade no longer boots.) (I made a point of not perusing my previous results to avoid influencing this test.) |
What is the difference between "1.20220308_buster" and "1.20220308" in terms of version of firmware used? The latest was working for me. Is the failure repeatable? Can you still ssh in? |
I do not know.
100% repeatable for any of the tests I repeated. I usually SSH in for these tests.
Some of these tests were performed in a system w/out a GUI. (That system no longer boots.) Some were performed with Gnome desktop installed, Resolution is 1600x1200. Gnome display settings do not show the refresh rate. The specs I found were for vertical and horizontal refresh rate that were useful when we needed to configure modelines. (It is an older LCD monitor.) It is a DVI display connected via DVI <-> HDMI adapter. |
You can run
Check dmesg output for working vs non-working. They may be errors that give a clue. |
Here is what I captured for several versions (including as installed) along with captures of
firmware version 1.20220120 (earliest trouble firmware) dmesg
firmware version 1.20220308_buster dmesg
firmware version 1.20220308 dmesg
In the last
|
In additio0n, I have been using 1.20220308_buster
1.20220308
The only difference is
|
I've said the bug was fixed on Jan 24 2022. All the firmware's you reported were from before the date of the fix. |
With the latest you provided (#1705 (comment)) The system does not complete booting so no further information can be collected. Is there a particular version of the firmware I should install this on top of? Should I be grabbing something from the repo that is newer than the tagged versions? Edit: I downloaded the latest from master and installed the files from .../boot with the following result
This looks encouraging. BTW, this most recent testing (since the collection of
Do you still want me to test with start4.elf and fixup4.dat that you linked? |
Just tested again with my linked version:
All seems happy for me, and looks identical to the version you are running.
|
This part of Hank's output stood out for me: firmware version 1.20220308
The firmware version tag would suggest it's based on the code from 2022-03-08, while the |
What's next for this? The end goal on my part is to see working firmware in the Debian repos for Bookworm on the 4B. Is there anything I can do to help this along? Should I continue to test the master branch? Wait for a tagged release? Anything else I can do to help? Thanks! |
The stable branch of raspberrypi/firmware was updated yesterday (in preparation for an update to RPiOS). Assuming you are happy with that firmware then I'd suggest updating your package to that. |
popcornmix dijo [Tue, Mar 29, 2022 at 07:54:28AM -0700]:
The stable branch of raspberrypi/firmware was updated yesterday (in preparation for an update to RPiOS).
I suspect it will get a tag when apt is updated.
Assuming you are happy with that firmware then I'd suggest updating your package to that.
Great news!
I will test it today, time allowing.
|
Gunnar Wolf dijo [Tue, Mar 29, 2022 at 10:44:48AM -0600]:
popcornmix dijo [Tue, Mar 29, 2022 at 07:54:28AM -0700]:
> The stable branch of raspberrypi/firmware was updated yesterday (in preparation for an update to RPiOS).
> I suspect it will get a tag when apt is updated.
>
> Assuming you are happy with that firmware then I'd suggest updating your package to that.
Great news!
I will test it today, time allowing.
OK, I didn't find it -- and re-read your mail, and I now see it is not
yet updated ☹
Anyway, I will... Wait patiently for it ☺
|
I've tested the latest code just downloaded from master (995e9f0) and it looks good as far as this issue goes. |
HankB dijo [Tue, Mar 29, 2022 at 05:54:16PM -0700]:
Hmmm... Odd -- I tested the same files in my RPi p400, and I still see In any case, those are the files I downloaded, please tell me if
I guess this is related, and I have not seen it commented in this
|
@gwolf the start* files are more significant than the fixup* files. |
My process was to download the entire repo and then copy the files over
```text
wget https://github.com/raspberrypi/firmware/archive/refs/heads/master.zip
unzip master.zip
cd ./firmware-master/boot
cp bootcode.bin *.dat *.elf /boot/firmware
```
…On Wed, Mar 30, 2022 at 1:19 PM popcornmix ***@***.***> wrote:
@gwolf <https://github.com/gwolf> the start* files are more significant
than the fixup* files.
Report output of ./vcdbg version to confirm you are running updated
firmware.
—
Reply to this email directly, view it on GitHub
<#1705 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZM47QEAUVNOIHPCQFUZ7LVCSLJDANCNFSM5QZB3S2Q>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Beautiful Sunny Winfield
|
Right! I was missing *.elf. Having downloaded those as well, I can confirm everything works fine again. |
Stable firmware is now in apt for rpios (and firmware repo has Once the debian bookworm firmware package is updated this issue should be resolved. |
I have tested the tagged firmware |
HankB dijo [Tue, Mar 29, 2022 at 05:54:16PM -0700]:
I've tested the latest code just downloaded from master
(995e9f0) and it looks good as far
as this issue goes.
Hmmm... Odd -- I tested the same files in my RPi p400, and I still see
the buggy behavior :-(
In any case, those are the files I downloaded, please tell me if
something does not match your end:
$ for i in fixup{4cd,4,4db,4x,_cd,_db,_x,}.dat bootcode.bin ; do wget https://github.com/raspberrypi/firmware/blob/995e9f03d17ab09a8821feb85cee368f29d80f89/boot/$i?raw=true -O $i;done
(...)
$ sha256sum fixup* bootcode.bin
22db24c621c326d907c7b8c5975b1730e6ce78dea680bec3958d907093031638 fixup4cd.dat
7d28775bff4781bda065f37fbb64c88ed1b56d1f4af79d85f792032f55bb6de7 fixup4.dat
b0d299dd46ddecd2c4eeeca61f42d114a0c464dcd6165861a662d118daa3afc0 fixup4db.dat
495076ed0488703ba59bd0d43bc577ad1695470379263854197a752cd1989330 fixup4x.dat
22db24c621c326d907c7b8c5975b1730e6ce78dea680bec3958d907093031638 fixup_cd.dat
8e90c8a379f3f99ee59370c50e48853db82669dbd6515d4ce08a24307d3dc4c5 fixup.dat
4f5d2433956f64cec640ae91dc47bdea3aa2c6c7cc579faafb779826bd7e554c fixup_db.dat
82bbf5a3f86f73a41e9f8975deb75e50ab4d7581500a43ec7f0fcc42214948dd fixup_x.dat
69309823da13dc96b89e3d82b44f820e4f84efa79d207adad2c8784559794f03
bootcode.bin
I guess this is related, and I have not seen it commented in this
issue: when I try to start up sway (Wayland compositor), I get:
00:00:10.038 [wlr] [backend/backend.c:371] Failed to open any DRM device
00:00:10.056 [sway/server.c:53] Unable to create backend
|
Hi My test procedure (this morning.)
Checking the files I get
I copied the files from Perhaps related: I see that the Pi 400 image on the download page looks like the same image that was previously there for the Pi 4B (same filename: Is there anything else I can check? |
Describe the bug
Upgrading
raspi-firmware
on Debian Bookworm on a Pi 4B results in significant performance degradation.To reproduce
20220121_raspi_4_bookworm.img.xz
to an SD card or SSD.apt update
apt install raspi-firmware
The firmware updates:
Expected behaviour
Normal performance and behavior following upgrade of
raspi-firmware
Actual behaviour
Severely degraded performance and seeming inability for S/W to determine and control available processor clocks.
System
raspios
not available on Debian.Pi 4B/8GB and Pi 4B/2GB
cat /etc/rpi-issue
)?vcgencmd version
)?vcgencmd
is not available on Debian. Does the version information listed above answer this?uname -a
)?Logs
/var/log/kern.log at https://paste.debian.net/1234272/
Additional context
I have posted my notes with further detail at https://github.com/HankB/Pi-4B-bookworm-performance
The text was updated successfully, but these errors were encountered: