You might try my script here instead. It’s been tested to build on a freshly flashed nano Image and in theory installs any version of OpenCV available in git. Both Python 2 and 3 support are enabled in the build.
To build version 4.0.0:
git clone https://github.com/mdegans/nano_build_opencv.git
You can replace 4.0.0 with 4.1.0 if you want (or any git branch/tag). To help ensure a successful build you may wish to build without the graphical environment running on the nano. To temporarily do this, ssh into the nano, run sudo systemctl isolate multi-user.target, and then start the build as shown above. 4.0.0 has not been tested to build, but it should. 4.1.0 has been tested to build.
I think previously I didnt added swap on my nano and may be because of this it was showing some error.
This time I added swap and the script worked fine. Although it took 6-7 hrs for the complete setup but yes after its done, I can see the latest version of opencv in python3.
For me, when building with make -j3 it was fine until it was time to link and test, at which point it would hit a wall swapping and fail when swap ran out. If you do add a swap file or partition, I’d recommend doing it via a reliable, fast, external ssd.
Swap works by treating disk as ram, and when you’re moving things back and forth constantly as happens in a build, that translates into a lot of flash wear. If you swap off the sdcard, not only is it slow, it’s likely to wear the card down faster than more modern ssd designs, especially Optane. One of these in an external nvme enclosure, attached via USB3, should be much closer to having 16 or 32 more GB of ram on your nano (than a micro-sd ever will). Optane is usually normally used to cache ssds, but you can use it like this as well and it should work fine, though the second generation may not.
Of course, if you want to build faster than that, please see this thread for instructions on how to set up cross compilation.
In my experience, I have found the read IO speeds of uSD on Jetson nano (84.63 MB/Sec)to be faster than a USB3 flashdrive (31.02 MB/Sec). Could you cross-check the IO speeds you are seeing on Optane and let us know ?
I measureed the read speeds of both the devices via
If you’re using a very slow flash drive, then yes, it might be worse. I was suggesting a nvme or sata ssd attached via usb3 (specifically, Optane is probably the best for this). That should be much faster than a microsd.
Linked Medium post simply says “except for Jetson Nano” I’m not sure what that means. I just tried with a Samsung Evo 860 sata in a usb3 enclosure and got a respectable…
test@test-nano:/$ sudo hdparm -t /dev/sda
Timing buffered disk reads: 874 MB in 3.00 seconds = 290.91 MB/sec
Dude was testing with I dunno what. I just re-ran it and got nearly identical results. Maybe he was using a usb-2 cable or something silly like that.
I don’t know what to tell you. I just ran a benchmark (see my edited post). Given the drive is capable of faster than that, it’s probably about the limit. Then again i’ve never benchmarked that specific enclosure (that drive is used for a Wii U via usb2, so idrc), It is certainly capable of faster than you claim, however.
291 MB/Sec looks like decent number. I will try to replicate that at my end (but even if I cannot … I wouldn’t assume that you are silly or you are lying or anything like that … I will perhaps ask which is your USB to SATA adapter or something like that).
I had a couple of other USB devices on other USB ports (WiFi dongle and kbd/mouse dongle). But they were mostly idle, so I dont think that should create too much of a problem
I dont like the comment you made above (something silly like that ). Note that we are discussing and cross-checking facts and numbers here … a little more decent tone would be conductive of a proper discussion. Note that I am not questioning your credibility or technical acumen here. I was just asking you the numbers you are seeing and I am just documenting the numbers I have seen. Thats how technical people operate.
It’s nothing fancy and it has stickers all over it so I couldn’t tell you the brand, but it’s a sata to usb-c 3.0 enclosure and from that I have a usb 3.0 a->c cable going to the nano. Drive inside is an Evo 860 sata.
Can you post the results of a lsusb -vvv with the flash drive plugged into the nano please?
Yeah. I noticed the speed is about half of the drive’s full speed. I think that may be a limitation of how much bandwith the USB 3 bus has on Nano. I think I recall reading in the documentation somewhere something about that. That speed limit would still not explain why your device doesn’t operate at the full 120 (as it’s less than 250)… Or maybe it does. It’s a puzzlement.