Why does Raspberry Pi freeze at 99% build?

I am following this tutorial: OpenCV: Installation in Linux

Following the Build Core Modules route at the top.

All the steps before cmake --build . appear to work fine.

Build takes > 6 hours, and when the console says 99% done, the computer freezes. Mouse cursor won’t move.

Yesterday I let the thing run all night, and this morning it was frozen at 100%.

Is this just part of the build process? Or is something wrong?

the last steps are mostly linking steps. linking takes LOTS of RAM and also CPU.

post everything you do, all the configuration. maybe we can see an issue there. use the post editor’s “preformatted text” styling for this information.

@ jstr0437. What’s rpi model? And what swap size before make j-4?

Btw, when is reached @ 99% Did you get an error or not? If not, then probably take a little long than up to 45 minutes unstill 100% completed done. Mine took about less than an 45 to an hour to completed.

Mine stays stuck at 99 or 100% for hours, but never shows an error.

Raspberry pi model is 3B.

I’m wondering how to post it when keyboard & mouse lock up. I’ve restarted the thing a couple times but obviously the output gets wiped out when I do that.

That very good. Wait at least 2 hrs. You will see completed done!. If not set swap size to 4096 and used make make -j1 instead of -j4.
Swap size:

  • 2048 <== this take a, bit longer
  • 4096 <== this take about 5 hrs
  • 8196 <== this take about 3 hrs
    When donned, set back swap size to 100

Btw, don’t used link that you posted. Good sites pyimagesearch, learnopencv and some other.

Btw, If you have fan or heat sink or some bolt or nut to cool off rpi 3B.

You should get rpi 4B with 4 or 8gb that set u less than an hour. Assumed 45 minutes.

I did this, and the computer still froze.

I decided to look at the partition size. It looks like boot is only ~200 MB, while the rest of the 32 GB does not appear to be part of any partition.

Could that be part of the problem?

Also noticed this in console output:

– Looking for ccache - not found

– Performing Test HAVE_C_WSUGGEST_OVERRIDE - Failed
– Performing Test HAVE_CPU_FP16_SUPPORT - Failed
– No package ‘gtk±3.0’ found
– Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
– Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
– Could NOT find Atlas (missing: Atlas_CLAPACK_INCLUDE_DIR)
– Looking for sgemm_ - not found
– Looking for cheev_ - not found

There may be more failures. These are just the ones I found in a couple minutes.

Any of these look like the cause?

Fixed it. Things that helped:

  • Set swap size to 4096
  • ran sudo raspi-config and clicked the option that expands the hard disk partition to the entire SD card.

I got a funny feeling yesterday when I opened up the SD card on my mac and looked at the partition size. One partition was ~200 MB. The rest of the disk was not part of any partition at all. That’s what motivated changing the partition size. I suspect that was a problem because the computer needed a large amount of virtual memory, yet virtual memory was limited to ~150 MB which by today’s standards is nothing.

Glad you solved problem.