Nano hangs whilst building OpenCV 4.5.2

Hi – I am trying to install a recent OpenCV with cuda support.
Using Jetson Nano with JetPack 4.5
I am following the quite detailed instructions at except that I haven’t used his method of increasing swap space. Instead, I just adjusted the zram setting to give 4Gb (system is running on a 128Gb sd-card)
/dev/zram3 lzo 989M 4K 81B 12K 4 [SWAP]
/dev/zram2 lzo 989M 4K 81B 12K 4 [SWAP]
/dev/zram1 lzo 989M 4K 81B 12K 4 [SWAP]
/dev/zram0 lzo 989M 4K 81B 12K 4 [SWAP]

Everything seemed to go to plan until the Make step when the whole system seemed to hang (in a mad loop judging by the heatsink). The last line displayed was …
[100%] Built target open_pref_superres

If I am to believe the screen dump on the web site it is just before two final linking commands. So close and so far.
Please note I am very new to Jetson (2nd day now) and I only want to use the machine not dismantle the engine and gearbox. So I can follow instructions but do not understand everything.

Thanks for your patience

you might try to run the build process with only one thread make -j1 - this will take longer, but requires less memory.

Or you can try this build script: GitHub - mdegans/nano_build_opencv: Build OpenCV on Nvidia Jetson Nano

No idea what your zram swap will result in, but also note that the last link stages of opencv may take up to 15 mins when natively building on Nano. As long as you don’t see OoM error, you may try further.
Be also sure you have enough space on disk for building (if not or unsure, you may use an external disk for this).

dkreutz, I was planning to try your suggestion of -j1 but figured I would let it run overnight. In the meantime I tried the other link you suggested (mdegans) and accidently triggered the build
It ran for over 6 hours but in the end worked and seems to have installed open cv 4.5.2 on jetpack 4.5.
I will run proper tests tomorrow but so far it looks great !
Thanks for the pointer.