Skip to content
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

HASS Docker Image unable to load on Raspberry Pi 5 (jemalloc) #103173

Closed
sieren opened this issue Nov 1, 2023 · 8 comments
Closed

HASS Docker Image unable to load on Raspberry Pi 5 (jemalloc) #103173

sieren opened this issue Nov 1, 2023 · 8 comments

Comments

@sieren
Copy link

sieren commented Nov 1, 2023

The problem

When trying to boot up HASS in a Docker Environment on Raspberry Pi 5 this ultimately results in:

homeassistant  | <jemalloc>: Unsupported system page size
homeassistant  | <jemalloc>: Unsupported system page size
homeassistant  | <jemalloc>: Unsupported system page size
homeassistant  | Fatal Python error: _PyRuntimeState_Init: memory allocation failed
homeassistant  | Python runtime state: unknown
homeassistant  |
homeassistant  | [15:16:11] INFO: Home Assistant Core finish process exit code 1
homeassistant  | [15:16:11] INFO: Home Assistant Core service shutdown

I tried to figure whether jemalloc was disabled specifically for RPI 4 (which is where this container ran on before) but could not find any relevant parts of the code.

For now adding

    environment:
      - DISABLE_JEMALLOC=true

to docker-compose.yml seems to be an acceptable workaround.

What version of Home Assistant Core has the issue?

core-2023.10.5

What was the last working version of Home Assistant Core?

core-2023.10.5

What type of installation are you running?

Home Assistant Container

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@mib1185
Copy link
Contributor

mib1185 commented Nov 1, 2023

the pi 5 is not supported, yet.
See: https://www.home-assistant.io/blog/2023/10/17/expected-support-for-raspberry-pi-5
in this blog post, you will also find a linkt to the GitHub discussion about hardware support of pi 5 😉

@mib1185 mib1185 closed this as completed Nov 1, 2023
@sieren
Copy link
Author

sieren commented Nov 1, 2023

Thanks. I saw the discussion but I figured it was more about HASS OS rather than the docker image :)
Anyway, thanks for clarifying. Figured the workaround might help folks who run HASS already via Docker.

@mib1185
Copy link
Contributor

mib1185 commented Nov 1, 2023

I found this in the docs about possible issues with jemalloc when using the docker image:
https://www.home-assistant.io/installation/raspberrypi#optimizations

@niggowai
Copy link

niggowai commented Nov 5, 2023

I'm experiencing the same issues on Asahi Linux, since Apple Silicon also has 16k pages. i worked around it by recompiling and reinstalling jemalloc in the container using a Dockerfile
Hope that helps for HA to support more page sizes soon.
Since jemalloc doesn't allow Dynamic page sizes now and in the future, jemalloc/jemalloc#467, there must be provided more docker images with different page sizes.

@sieren FYI You may head over to the Asahi Linux Software Support Site which lists the Software broken and fixed for 16k pages

@PatrickTetz
Copy link

Hey, I am not sure how much merit there is to this statement, but if it is true, the fix should be trivial:

Jemalloc supports using a smaller runtime page size than it was compiled with. So we simply always increase the page-size on arm64.

Source

@sieren, the environment flag you mentioned to solve the issue temporarily is only for the HASS image, I assume? I am stuck with the supervisor image, and the flag is not working. Unfortunately, they also have the same jemalloc issue.

@sieren
Copy link
Author

sieren commented Nov 15, 2023

@PatrickTetz Indeed, I haven't verified this on the supervisor image, just the regular ol' HASS docker image

@ohadlevy
Copy link
Contributor

@sieren, the environment flag you mentioned to solve the issue temporarily is only for the HASS image, I assume? I am stuck with the supervisor image, and the flag is not working. Unfortunately, they also have the same jemalloc issue.

@PatrickTetz raspberrypi/bookworm-feedback#107 (comment) worked for me

@PatrickTetz
Copy link

@ohadlevy this seems to work great, thanks for sharing!

@github-actions github-actions bot locked and limited conversation to collaborators Dec 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants