adam van gaalen
Posts: 43
Joined: Sun Jul 01, 2012 11:51 am

gpu_mem=16 in /boot/config.txt causes bus-errors, panics etc.

Tue Jul 20, 2021 4:53 pm

I have been struggling for a while with repeatedly occuring (mainly man-db-)bus errors and kernel panics on a Raspberry Pi Zero.
The errors showed right after moving the Raspios-image to an SD-card, booting it and then doing like 'apt-get install', 'apt-get update', 'apt-get upgrade' etc.

I believe I have narrowed the problems down to the line: 'gpu_mem=16' in /boot/config.txt

At first I started mistrusting the SD-card but the problems showed on all cards (at least 5) that I used.
I used the 'gpu_mem=16' setting in order to get as much space as possible to be available as real memory.

User avatar
thagrol
Posts: 5514
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: gpu_mem=16 in /boot/config.txt causes bus-errors, panics etc.

Tue Jul 20, 2021 6:27 pm

16 should be enough for command line logins and without camera support.

Desktop use may require more. The camera module definitely will.
I'm a volunteer. Take me for granted or abuse my support and I will walk away

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

adam van gaalen
Posts: 43
Joined: Sun Jul 01, 2012 11:51 am

Re: gpu_mem=16 in /boot/config.txt causes bus-errors, panics etc.

Tue Jul 20, 2021 8:42 pm

I've tried with the full and lite versions of raspios, not using any desktop or graphics at all, it's commandline ONLY (through ssh).

Therefore I find it strange to notice bus-errors while all that I was trying to do is supply as much as possible memory to the process-space.

OK if gpu_mem=16 is a bad idea, but I did not use any gpu-resources and certainly expected other messages than bus-errors here...

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 29300
Joined: Sat Jul 30, 2011 7:41 pm

Re: gpu_mem=16 in /boot/config.txt causes bus-errors, panics etc.

Tue Jul 20, 2021 9:18 pm

The obvious question is do the errors go away with larger values for gpu_mem?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Working in the Applications Team.

adam van gaalen
Posts: 43
Joined: Sun Jul 01, 2012 11:51 am

Re: gpu_mem=16 in /boot/config.txt causes bus-errors, panics etc.

Wed Jul 21, 2021 11:42 pm

Yes, they do.

Or maybe I should say that commenting-out the line (using the default value, whatever that is) solved it.

I have ordered a new Pi4 and will try things out there too... It could, of course, be a Pi0 problem...

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 29300
Joined: Sat Jul 30, 2011 7:41 pm

Re: gpu_mem=16 in /boot/config.txt causes bus-errors, panics etc.

Thu Jul 22, 2021 9:15 am

I suspect the firmware is simply running out of memory. I'd stick it at 32 instead, losing 16MB won't make a huge difference.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Working in the Applications Team.

adam van gaalen
Posts: 43
Joined: Sun Jul 01, 2012 11:51 am

Re: gpu_mem=16 in /boot/config.txt causes bus-errors, panics etc.

Thu Jul 22, 2021 3:52 pm

I'll change my 16 into 32 but I would have loved to see a message suggesting to do so... Would have saved me a lot of 'headache' and a few days... 16 used to work just fine for long time...

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 29300
Joined: Sat Jul 30, 2011 7:41 pm

Re: gpu_mem=16 in /boot/config.txt causes bus-errors, panics etc.

Thu Jul 22, 2021 4:03 pm

I expect a firmware change somewhere has used up a tiny bit more memory and pushed it over the edge, although it does depend on what features of the firmware you are using. What things are you getting the Pi to do that might involve firmware memory usage (camera, multiple screens, codec usage etc).
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Working in the Applications Team.

adam van gaalen
Posts: 43
Joined: Sun Jul 01, 2012 11:51 am

Re: gpu_mem=16 in /boot/config.txt causes bus-errors, panics etc.

Fri Jul 23, 2021 12:53 pm

As I said: Newly written SD-card, RJ45-USB-interface and monitor connected to view the boot-process, ssh to the Pi0, apt-get update
No more, no less.
I will give it one more go, this time without a screen. Will keep you updated.

adam van gaalen
Posts: 43
Joined: Sun Jul 01, 2012 11:51 am

Re: gpu_mem=16 in /boot/config.txt causes bus-errors, panics etc.

Fri Jul 23, 2021 1:08 pm

With just a RJ45-USB-interface connected:
[adam@mbookn 15:00:38] ~/procs % root !$
root test0berrypi
The authenticity of host 'test0berrypi.vangaalen.home (10.0.0.57)' can't be established.
ECDSA key fingerprint is SHA256:vUev6EZpsRY15wz3TvxT/jhKrQvnl3uQmxod+0CNt4s.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'test0berrypi.vangaalen.home,10.0.0.57' (ECDSA) to the list of known hosts.
pi@test0berrypi.vangaalen.home's password:
Linux raspberrypi 5.10.17+ #1414 Fri Apr 30 13:16:27 BST 2021 armv6l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

SSH is enabled and the default password for the 'pi' user has not been changed.
This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.

pi@raspberrypi:~$ uname -a
Linux raspberrypi 5.10.17+ #1414 Fri Apr 30 13:16:27 BST 2021 armv6l GNU/Linux
pi@raspberrypi:~$ sudo sh
# apt-get update
Get:1 http://archive.raspberrypi.org/debian buster InRelease [32.6 kB]
Get:2 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Get:3 http://archive.raspberrypi.org/debian buster/main armhf Packages [376 kB]
Get:4 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages [13.0 MB]
Get:5 http://raspbian.raspberrypi.org/raspbian buster/contrib armhf Packages [58.7 kB]
Fetched 13.5 MB in 39s (346 kB/s)
Reading package lists... Done
# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
python-colorzero
Use 'sudo apt autoremove' to remove it.
The following packages will be upgraded:
base-files firmware-atheros firmware-brcm80211 firmware-libertas firmware-misc-nonfree firmware-realtek isc-dhcp-client isc-dhcp-common klibc-utils libgcrypt20 libgnutls30 libhogweed4 libklibc liblz4-1 libnettle6
libraspberrypi-bin libraspberrypi-dev libraspberrypi-doc libraspberrypi0 libx11-6 libx11-data libxml2 linux-libc-dev pi-bluetooth python-gpiozero python-spidev python3-gpiozero python3-spidev
raspberrypi-bootloader raspberrypi-kernel raspberrypi-sys-mods rpi-eeprom rpi-update
33 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 138 MB of archives.
After this operation, 5093 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.raspberrypi.org/debian buster/main armhf firmware-atheros all 1:20190114-2+rpt1 [4012 kB]
Get:6 http://archive.raspberrypi.org/debian buster/main armhf firmware-brcm80211 all 1:20190114-2+rpt1 [4600 kB]
Get:2 http://mirror.transip.net/raspbian/raspbian buster/main armhf base-files armhf 10.3+rpi1+deb10u10 [70.2 kB]
Get:3 http://mirror.transip.net/raspbian/raspbian buster/main armhf libgcrypt20 armhf 1.8.4-5+deb10u1 [500 kB]
Get:4 http://mirror.transip.net/raspbian/raspbian buster/main armhf libnettle6 armhf 3.4.1-1+deb10u1 [223 kB]
Get:5 http://mirror.transip.net/raspbian/raspbian buster/main armhf libhogweed4 armhf 3.4.1-1+deb10u1 [130 kB]
Get:7 http://mirror.transip.net/raspbian/raspbian buster/main armhf libgnutls30 armhf 3.6.7-4+deb10u7 [1049 kB]
Get:8 http://mirror.transip.net/raspbian/raspbian buster/main armhf liblz4-1 armhf 1.8.3-1+deb10u1 [49.7 kB]
Get:9 http://mirror.transip.net/raspbian/raspbian buster/main armhf isc-dhcp-client armhf 4.4.1-2+deb10u1 [295 kB]
Get:10 http://mirror.transip.net/raspbian/raspbian buster/main armhf isc-dhcp-common armhf 4.4.1-2+deb10u1 [144 kB]
Get:11 http://mirror.transip.net/raspbian/raspbian buster/main armhf klibc-utils armhf 2.0.6-1+rpi1+deb10u1 [87.1 kB]
Get:12 http://mirror.transip.net/raspbian/raspbian buster/main armhf libklibc armhf 2.0.6-1+rpi1+deb10u1 [52.8 kB]
Get:13 http://mirror.transip.net/raspbian/raspbian buster/main armhf libx11-data all 2:1.6.7-1+deb10u2 [299 kB]
Get:14 http://mirror.transip.net/raspbian/raspbian buster/main armhf libx11-6 armhf 2:1.6.7-1+deb10u2 [689 kB]
Get:15 http://archive.raspberrypi.org/debian buster/main armhf firmware-libertas all 1:20190114-2+rpt1 [3424 kB]
Get:16 http://mirror.transip.net/raspbian/raspbian buster/main armhf libxml2 armhf 2.9.4+dfsg1-7+deb10u2 [572 kB]
Get:17 http://archive.raspberrypi.org/debian buster/main armhf firmware-misc-nonfree all 1:20190114-2+rpt1 [3341 kB]
Get:18 http://archive.raspberrypi.org/debian buster/main armhf firmware-realtek all 1:20190114-2+rpt1 [506 kB]
Get:19 http://archive.raspberrypi.org/debian buster/main armhf libraspberrypi-doc armhf 1:1.20210527-1 [31.4 MB]
Get:20 http://archive.raspberrypi.org/debian buster/main armhf libraspberrypi-dev armhf 1:1.20210527-1 [400 kB]
Get:21 http://archive.raspberrypi.org/debian buster/main armhf raspberrypi-kernel armhf 1:1.20210527-1 [78.9 MB]
Get:22 http://archive.raspberrypi.org/debian buster/main armhf libraspberrypi-bin armhf 1:1.20210527-1 [341 kB]
Get:23 http://archive.raspberrypi.org/debian buster/main armhf libraspberrypi0 armhf 1:1.20210527-1 [847 kB]
Get:24 http://archive.raspberrypi.org/debian buster/main armhf raspberrypi-bootloader armhf 1:1.20210527-1 [4493 kB]
Get:25 http://archive.raspberrypi.org/debian buster/main armhf linux-libc-dev armhf 1:1.20210527-1 [1011 kB]
Get:26 http://archive.raspberrypi.org/debian buster/main armhf raspberrypi-sys-mods armhf 20210706 [12.2 kB]
Get:27 http://archive.raspberrypi.org/debian buster/main armhf pi-bluetooth all 0.1.17 [5608 B]
Get:28 http://archive.raspberrypi.org/debian buster/main armhf python-gpiozero all 1.6.2-1 [118 kB]
Get:29 http://archive.raspberrypi.org/debian buster/main armhf python-spidev armhf 20200602~200721-1~buster [11.8 kB]
Get:30 http://archive.raspberrypi.org/debian buster/main armhf python3-gpiozero all 1.6.2-1 [121 kB]
Get:31 http://archive.raspberrypi.org/debian buster/main armhf python3-spidev armhf 20200602~200721-1~buster [11.7 kB]
Get:32 http://archive.raspberrypi.org/debian buster/main armhf rpi-eeprom armhf 12.9-1 [701 kB]
Get:33 http://archive.raspberrypi.org/debian buster/main armhf rpi-update all 20210618 [7920 B]
Fetched 138 MB in 2min 47s (827 kB/s)
dpkg-deb (subprocess): cannot copy archive member from '/var/cache/apt/archives/libgnutls30_3.6.7-4+deb10u7_armhf.deb' to decompressor pipe: failed to write (Broken pipe)
dpkg-deb: error: <decompress> subprocess was killed by signal (Bus error)


On a 2nd run, on again a newly written SD-card, I noticed these differences:
Get:1 http://archive.raspberrypi.org/debian buster/main armhf firmware-atheros all 1:20190114-2+rpt1 [4012 kB]
Get:9 http://archive.raspberrypi.org/debian buster/main armhf firmware-brcm80211 all 1:20190114-2+rpt1 [4600 kB]
Get:2 http://mirror.transip.net/raspbian/raspbian buster/main armhf base-files armhf 10.3+rpi1+deb10u10 [70.2 kB]

Get:20 http://archive.raspberrypi.org/debian buster/main armhf libraspberrypi-dev armhf 1:1.20210527-1 [400 kB]
Get:21 http://archive.raspberrypi.org/debian buster/main armhf raspberrypi-kernel armhf 1:1.20210527-1 [78.9 MB]
Get:21 http://archive.raspberrypi.org/debian buster/main armhf raspberrypi-kernel armhf 1:1.20210527-1 [78.9 MB]
Get:22 http://archive.raspberrypi.org/debian buster/main armhf libraspberrypi-bin armhf 1:1.20210527-1 [341 kB]

Get:33 http://archive.raspberrypi.org/debian buster/main armhf rpi-update all 20210618 [7920 B]
Fetched 107 MB in 3min 21s (533 kB/s)

and the upgrade crashed with lines:
Removing 'diversion of /boot/overlays/w1-gpio.dtbo to /usr/share/rpikernelhack/overlays/w1-gpio.dtbo by rpikernelhack'
Removing 'diversion of /boot/overlays/w5500.dtbo to /usr/share/rpikernelhack/overlays/w5500.dtbo by rpikernelhack'
Removing 'diversion of /boot/overlays/wittypi.dtbo to /usr/share/rpikernelhack/overlays/wittypi.dtbo by rpikernelhack'
Removing 'diversion of /boot/overlays/wm8960-soundcard.dtbo to /usr/share/rpikernelhack/overlays/wm8960-soundcard.dtbo by rpikernelhack'
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 5.10.17+ /boot/kernel.img
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.10.17+ /boot/kernel.img
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 5.10.17-v7+ /boot/kernel7.img
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.10.17-v7+ /boot/kernel7.img
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 5.10.17-v7l+ /boot/kernel7l.img
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.10.17-v7l+ /boot/kernel7l.img
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 5.10.17-v8+ /boot/kernel8.img
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.10.17-v8+ /boot/kernel8.img
Setting up libklibc:armhf (2.0.6-1+rpi1+deb10u1) ...
Setting up firmware-brcm80211 (1:20190114-2+rpt1) ...
Setting up python3-gpiozero (1.6.2-1) ...
Bus error
Traceback (most recent call last):
File "/usr/bin/py3compile", line 290, in <module>
main()
File "/usr/bin/py3compile", line 270, in main
options.force, options.optimize, e_patterns)
File "/usr/bin/py3compile", line 154, in compile
for fn, versions_to_compile in filter_files(files, e_patterns, versions):
File "/usr/bin/py3compile", line 106, in filter_files
for fn in files:
File "/usr/share/python3/debpython/files.py", line 71, in filter_public
for fn in files:
File "/usr/share/python3/debpython/files.py", line 53, in from_package
raise Exception("cannot get content of %s" % package_name)
Exception: cannot get content of python3-gpiozero
dpkg: error processing package python3-gpiozero (--configure):
installed python3-gpiozero package post-installation script subprocess returned error exit status 1
Setting up libx11-data (2:1.6.7-1+deb10u2) ...
Setting up firmware-realtek (1:20190114-2+rpt1) ...
update-initramfs: deferring update (trigger activated)
Setting up rpi-update (20210618) ...
Setting up raspberrypi-bootloader (1:1.20210527-1) ...
Removing 'diversion of /boot/start.elf to /usr/share/rpikernelhack/start.elf by rpikernelhack'
Removing 'diversion of /boot/start_cd.elf to /usr/share/rpikernelhack/start_cd.elf by rpikernelhack'
Removing 'diversion of /boot/start_db.elf to /usr/share/rpikernelhack/start_db.elf by rpikernelhack'
Removing 'diversion of /boot/start_x.elf to /usr/share/rpikernelhack/start_x.elf by rpikernelhack'
Removing 'diversion of /boot/fixup.dat to /usr/share/rpikernelhack/fixup.dat by rpikernelhack'
Removing 'diversion of /boot/fixup_cd.dat to /usr/share/rpikernelhack/fixup_cd.dat by rpikernelhack'
Removing 'diversion of /boot/fixup_db.dat to /usr/share/rpikernelhack/fixup_db.dat by rpikernelhack'
Removing 'diversion of /boot/fixup_x.dat to /usr/share/rpikernelhack/fixup_x.dat by rpikernelhack'
Removing 'diversion of /boot/bootcode.bin to /usr/share/rpikernelhack/bootcode.bin by rpikernelhack'
Removing 'diversion of /boot/start4.elf to /usr/share/rpikernelhack/start4.elf by rpikernelhack'
Removing 'diversion of /boot/start4cd.elf to /usr/share/rpikernelhack/start4cd.elf by rpikernelhack'
Removing 'diversion of /boot/start4db.elf to /usr/share/rpikernelhack/start4db.elf by rpikernelhack'
Removing 'diversion of /boot/start4x.elf to /usr/share/rpikernelhack/start4x.elf by rpikernelhack'
Removing 'diversion of /boot/fixup4.dat to /usr/share/rpikernelhack/fixup4.dat by rpikernelhack'
Removing 'diversion of /boot/fixup4cd.dat to /usr/share/rpikernelhack/fixup4cd.dat by rpikernelhack'
Removing 'diversion of /boot/fixup4db.dat to /usr/share/rpikernelhack/fixup4db.dat by rpikernelhack'
Removing 'diversion of /boot/fixup4x.dat to /usr/share/rpikernelhack/fixup4x.dat by rpikernelhack'
Removing 'diversion of /boot/LICENCE.broadcom to /usr/share/rpikernelhack/LICENCE.broadcom by rpikernelhack'
Setting up libraspberrypi0 (1:1.20210527-1) ...
Setting up firmware-libertas (1:20190114-2+rpt1) ...
Setting up libx11-6:armhf (2:1.6.7-1+deb10u2) ...
Setting up isc-dhcp-common (4.4.1-2+deb10u1) ...
Setting up klibc-utils (2.0.6-1+rpi1+deb10u1) ...
Setting up libxml2:armhf (2.9.4+dfsg1-7+deb10u2) ...
Setting up pi-bluetooth (0.1.17) ...
Job for hciuart.service failed because the control process exited with error code.
See "systemctl status hciuart.service" and "journalctl -xe" for details.
Job for hciuart.service failed because the control process exited with error code.
See "systemctl status hciuart.service" and "journalctl -xe" for details.
Setting up libraspberrypi-doc (1:1.20210527-1) ...
Setting up libraspberrypi-bin (1:1.20210527-1) ...
Setting up libraspberrypi-dev (1:1.20210527-1) ...
Setting up rpi-eeprom (12.9-1) ...
Processing triggers for libc-bin (2.28-10+rpi1) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for install-info (6.5.0.dfsg.1-4+b1) ...
Processing triggers for initramfs-tools (0.133+deb10u1) ...
Errors were encountered while processing:
python3-gpiozero
E: Sub-process /usr/bin/dpkg returned an error code (1)

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 29300
Joined: Sat Jul 30, 2011 7:41 pm

Re: gpu_mem=16 in /boot/config.txt causes bus-errors, panics etc.

Fri Jul 23, 2021 1:50 pm

It's unclear whether that was with gpu_mem=16 or 32, or default.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Working in the Applications Team.

User avatar
pasman1
Posts: 214
Joined: Mon Aug 10, 2020 3:01 pm
Location: Poland

Re: gpu_mem=16 in /boot/config.txt causes bus-errors, panics etc.

Fri Jul 23, 2021 3:27 pm

maybe your root partition is too small ?
first you download 138MB,
second time 107MB.
Pi4 RaspbOS 64+LXQT, linux 5.10.52-v8

adam van gaalen
Posts: 43
Joined: Sun Jul 01, 2012 11:51 am

Re: gpu_mem=16 in /boot/config.txt causes bus-errors, panics etc.

Fri Jul 23, 2021 9:19 pm

>> It's unclear whether that was with gpu_mem=16 or 32, or default.
gpu_mem=16 that is what I had the problems with that now I am trying to dig in into a little deeper


>> maybe your root partition is too small ?
>> first you download 138MB,
>> second time 107MB.

Again, newly written SD-card...:
% ssh pi@test0berrypi
The authenticity of host 'test0berrypi.vangaalen.home (10.0.0.57)' can't be established.
ECDSA key fingerprint is SHA256:EzSwrg/pQ/eucDlulhOzEImSK3dTDuTLl7vb5I2CJso.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'test0berrypi.vangaalen.home,10.0.0.57' (ECDSA) to the list of known hosts.
pi@test0berrypi.vangaalen.home's password:
Linux raspberrypi 5.10.17+ #1414 Fri Apr 30 13:16:27 BST 2021 armv6l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

SSH is enabled and the default password for the 'pi' user has not been changed.
This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.

pi@raspberrypi:~$ df -klP
Filesystem 1024-blocks Used Available Capacity Mounted on
/dev/root 15019440 1290620 13085460 9% /
devtmpfs 211588 0 211588 0% /dev
tmpfs 244564 0 244564 0% /dev/shm
tmpfs 244564 6476 238088 3% /run
tmpfs 5120 4 5116 1% /run/lock
tmpfs 244564 0 244564 0% /sys/fs/cgroup
/dev/mmcblk0p1 258095 48834 209261 19% /boot
tmpfs 48912 0 48912 0% /run/user/1000
pi@raspberrypi:~$

This 'apt-get upgrade' ended like:
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 5.10.17+ /boot/kernel.img
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.10.17+ /boot/kernel.img
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 5.10.17-v7+ /boot/kernel7.img
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.10.17-v7+ /boot/kernel7.img
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 5.10.17-v7l+ /boot/kernel7l.img
/etc/kernel/postinst.d/apt-auto-removal:
Bus error
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.10.17-v7l+ /boot/kernel7l.img
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 5.10.17-v8+ /boot/kernel8.img
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.10.17-v8+ /boot/kernel8.img
Setting up libklibc:armhf (2.0.6-1+rpi1+deb10u1) ...
Setting up firmware-brcm80211 (1:20190114-2+rpt1) ...
Setting up python3-gpiozero (1.6.2-1) ...
Setting up libx11-data (2:1.6.7-1+deb10u2) ...
Setting up firmware-realtek (1:20190114-2+rpt1) ...
update-initramfs: deferring update (trigger activated)
Setting up rpi-update (20210618) ...
Setting up raspberrypi-bootloader (1:1.20210527-1) ...
Removing 'diversion of /boot/start.elf to /usr/share/rpikernelhack/start.elf by rpikernelhack'
Removing 'diversion of /boot/start_cd.elf to /usr/share/rpikernelhack/start_cd.elf by rpikernelhack'
Removing 'diversion of /boot/start_db.elf to /usr/share/rpikernelhack/start_db.elf by rpikernelhack'
Removing 'diversion of /boot/start_x.elf to /usr/share/rpikernelhack/start_x.elf by rpikernelhack'
Removing 'diversion of /boot/fixup.dat to /usr/share/rpikernelhack/fixup.dat by rpikernelhack'
Removing 'diversion of /boot/fixup_cd.dat to /usr/share/rpikernelhack/fixup_cd.dat by rpikernelhack'
Removing 'diversion of /boot/fixup_db.dat to /usr/share/rpikernelhack/fixup_db.dat by rpikernelhack'
Removing 'diversion of /boot/fixup_x.dat to /usr/share/rpikernelhack/fixup_x.dat by rpikernelhack'
Removing 'diversion of /boot/bootcode.bin to /usr/share/rpikernelhack/bootcode.bin by rpikernelhack'
Removing 'diversion of /boot/start4.elf to /usr/share/rpikernelhack/start4.elf by rpikernelhack'
Removing 'diversion of /boot/start4cd.elf to /usr/share/rpikernelhack/start4cd.elf by rpikernelhack'
Removing 'diversion of /boot/start4db.elf to /usr/share/rpikernelhack/start4db.elf by rpikernelhack'
Removing 'diversion of /boot/start4x.elf to /usr/share/rpikernelhack/start4x.elf by rpikernelhack'
Removing 'diversion of /boot/fixup4.dat to /usr/share/rpikernelhack/fixup4.dat by rpikernelhack'
Removing 'diversion of /boot/fixup4cd.dat to /usr/share/rpikernelhack/fixup4cd.dat by rpikernelhack'
Removing 'diversion of /boot/fixup4db.dat to /usr/share/rpikernelhack/fixup4db.dat by rpikernelhack'
Removing 'diversion of /boot/fixup4x.dat to /usr/share/rpikernelhack/fixup4x.dat by rpikernelhack'
Removing 'diversion of /boot/LICENCE.broadcom to /usr/share/rpikernelhack/LICENCE.broadcom by rpikernelhack'
Setting up libraspberrypi0 (1:1.20210527-1) ...
Setting up firmware-libertas (1:20190114-2+rpt1) ...
Setting up libx11-6:armhf (2:1.6.7-1+deb10u2) ...
Setting up isc-dhcp-common (4.4.1-2+deb10u1) ...
Setting up klibc-utils (2.0.6-1+rpi1+deb10u1) ...
Setting up libxml2:armhf (2.9.4+dfsg1-7+deb10u2) ...
Setting up pi-bluetooth (0.1.17) ...
Job for hciuart.service failed because the control process exited with error code.
See "systemctl status hciuart.service" and "journalctl -xe" for details.
Job for hciuart.service failed because the control process exited with error code.
See "systemctl status hciuart.service" and "journalctl -xe" for details.
Setting up libraspberrypi-doc (1:1.20210527-1) ...
Setting up libraspberrypi-bin (1:1.20210527-1) ...
Setting up libraspberrypi-dev (1:1.20210527-1) ...
Setting up rpi-eeprom (12.9-1) ...
Processing triggers for libc-bin (2.28-10+rpi1) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for install-info (6.5.0.dfsg.1-4+b1) ...
Processing triggers for initramfs-tools (0.133+deb10u1) ...
#

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 29300
Joined: Sat Jul 30, 2011 7:41 pm

Re: gpu_mem=16 in /boot/config.txt causes bus-errors, panics etc.

Sat Jul 24, 2021 8:31 am

If the problem goes away with 32, just use that. I doubt we will spend any time trying to find out the problem and its likely unfixable anyway, as it seems changes to the firmware need a bit more memory, and changes care there for a reason.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Working in the Applications Team.

cleverca22
Posts: 4336
Joined: Sat Aug 18, 2012 2:33 pm

Re: gpu_mem=16 in /boot/config.txt causes bus-errors, panics etc.

Sat Jul 24, 2021 6:25 pm

some extra info that might help

1:

Code: Select all

root@pi400:~# vcdbg malloc
Pool 0xbef0d278 (3edee784)
Malloc pool size=16M (pool=0x3ef0d278-0x3ff7ff2c)
0x3ef0d2a0 = malloc(128K) [call from 0x3ed55772]
0x3ef2d2c0 = malloc(28)   [call from 0x3ed1239c]
0x3ef2e000 = malloc(138K) [call from 0x3ec6c868]
0x3ef50c20 = malloc(512)  [v3d_gfxh16_thre]
0x3ef50e40 = malloc(7.3K) [dma_transfer_xfers]
0x3ef52b60 = malloc(10K)  [Gencmd service state]
0x3ef553a0 = malloc(180)  [vcos_cmd_entries]
...
0x3f0b0fc0 = malloc(20)   [mmal ports]
0x3f0b1000 = malloc(476)  [VCHIQ service]
0x3f0b1200 = malloc(476)  [VCHIQ service]
0x3f0b13f0 = hole(504)
0x3f0b1600 = malloc(476)  [VCHIQ service]
0x3f0b17f0 = hole(15M)
Malloced:1.6M Remaining:15M Failed allocs:0
this details what the firmware is using the heap for, you could potentially investigate that and try to reduce it
2:

Code: Select all

root@pi400:~# ls -lh /boot/start_cd.elf /boot/start.elf 
-rwxr-xr-x 1 root root 773K Jan 27 16:37 /boot/start_cd.elf
-rwxr-xr-x 1 root root 2.9M Jan 27 16:36 /boot/start.elf
the default start.elf has 2.9mb of code alone, so thats 2.9mb of your gpu_mem thats already eaten, before the firmware even starts
but start_cd is the "cut down" firmware with a large chunk of features missing
i believe adding "start_cd=1" to config.txt will switch over to that, and it could save ~2mb of gpu_mem, and impact how the rest is even used

trejan
Posts: 3586
Joined: Tue Jul 02, 2019 2:28 pm

Re: gpu_mem=16 in /boot/config.txt causes bus-errors, panics etc.

Sat Jul 24, 2021 7:36 pm

cleverca22 wrote:
Sat Jul 24, 2021 6:25 pm
but start_cd is the "cut down" firmware with a large chunk of features missing
i believe adding "start_cd=1" to config.txt will switch over to that, and it could save ~2mb of gpu_mem, and impact how the rest is even used
It automatically uses start_cd when gpu_mem=16

adam van gaalen
Posts: 43
Joined: Sun Jul 01, 2012 11:51 am

Re: gpu_mem=16 in /boot/config.txt causes bus-errors, panics etc.

Sat Jul 24, 2021 8:34 pm

I'm happy with the suggestion to use 32 as a minimum. It has never been my intention to have you guys spend a lot of time on this.

Thanks for your help...

On the new Pi4, that came in today, I'll be using the default value!

The Pi0, that I used to do installations on, has now been put to rest for some time.
Eventually I will find another task for it like I found for the 20 other Pi's (models 0 to 4) I have running here ;-)

User avatar
kerry_s
Posts: 2264
Joined: Thu Jan 30, 2020 7:14 pm

Re: gpu_mem=16 in /boot/config.txt causes bus-errors, panics etc.

Sat Jul 24, 2021 10:15 pm

interesting.
i'm using manjaro xfce4, setting it up for raspad 3, i have coming.
only have a wireless mouse attached. been running these settings for a few days, browsing, movies, tv, youtube.
Attachments
Screenshot_2021-07-24_12-11-58.png
Screenshot_2021-07-24_12-11-58.png (68.25 KiB) Viewed 236 times

Return to “Troubleshooting”