Skip to content

picamera2 in Docker - Cannot allocate memory #1216

Closed Answered by signag
signag asked this question in Q&A
Discussion options

You must be logged in to vote

@davidplowman, thanks for clarification.

I tried to analyze this a little bit more.

Looking at the available cma on my Pi 5,
cat /proc/meminfo shows:

...
CmaTotal:          65536 kB
CmaFree:           49056 kB

Since, according to the picamera2-manual ch. 8.3, the 12MP Model 3 image requires 48 MB, this will probably be the bottleneck.

I increased cma by replacing

dtoverlay=vc4-kms-v3d

with

dtoverlay=vc4-kms-v3d,cma-512

in /boot/firmware/config.txt

Now, after reboot, I have:

CmaTotal:         524288 kB
CmaFree:          507808 kB

Now, the Cannot allocate memory error is gone when running the docker container with the Model 3 camera and a 12MP image is created.

Doesn't this indicate tha…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@signag
Comment options

@davidplowman
Comment options

@signag
Comment options

Answer selected by signag
@davidplowman
Comment options

@signag
Comment options

@davidplowman
Comment options

@signag
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants