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

Suggestion: add ATLAS/OpenBLAS to image #65

Closed
auscompgeek opened this issue Jan 13, 2019 · 4 comments · Fixed by #83
Closed

Suggestion: add ATLAS/OpenBLAS to image #65

auscompgeek opened this issue Jan 13, 2019 · 4 comments · Fixed by #83
Labels
enhancement New feature or request
Milestone

Comments

@auscompgeek
Copy link
Member

ATLAS and/or OpenBLAS are optimised implementations of BLAS/LAPACK. They will likely give a reasonable speedup for both OpenCV and numpy.

@PeterJohnson PeterJohnson added the enhancement New feature or request label Jan 13, 2019
@PeterJohnson
Copy link
Member

It's one or the other, not both. I have the OpenBLAS package install in #66, but compiling OpenCV with it is going to be more difficult.

@auscompgeek
Copy link
Member Author

Yeah, I'm not entirely sure which would be better to use, hence why I listed both.

From what I understand, Debian's ATLAS and OpenBLAS packages also provide libblas.so.3 and liblapack.so.3 via their alternatives mechanism, so I believe they'll work as a drop-in replacement without having to specifically link to them.

@PeterJohnson
Copy link
Member

PeterJohnson commented Jan 14, 2019

Yes, that works for numpy, but we build our own OpenCV, so I have to figure out how to get it to find it when cross-building, etc.

@auscompgeek
Copy link
Member Author

auscompgeek commented Jan 14, 2019

Ah, right.

Taking a closer look, I found that OpenCV is actually built without LAPACK:

https://github.com/wpilibsuite/FRCVision-pi-gen/blob/03dae15ddfbb01c31c457756bc390359e8e32c87/deps/03-build.sh#L39

From what I can tell, if you pull in the liblapack-dev package (and flip that ON), then it should be fine. Debian builds their OpenCV packages on sid like that it seems.

@PeterJohnson PeterJohnson added this to the 2019.3.1 milestone Feb 3, 2019
PeterJohnson added a commit that referenced this issue Feb 3, 2019
Fixes #17.

Stage 2 is fairly minimal, stage 3 builds/installs OpenCV and WPILib et al, and stage 4
builds/installs the FRCVision webdash and adds the vision examples.

Other changes:
- OpenCV compiled with ffmpeg, OpenBLAS, and libgtk (fixes #79, fixes #80)
- OpenBLAS added to image (fixes #65)
- C++ Makefile is more easily extensible (fixes #71)
- Sources for everything are bundled into image into /usr/src
- README updated (fixes #16)
- pkg-config files for wpilibc et al are now installed and C++ Makefile uses them (if compiled local to Pi)
- Both dynamic and static libs are included in image

The only downside of all these changes (particularly the ffmpeg, OpenBLAS, and libgtk inclusion)
is the image size is now over 3GB (800MB compressed). The previous image didn't quite fit on a
2GB card however.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants