OpenCV 4.5

I fired up my new Xavier NX (Jetpack 4.1.1) and discovered OpenCV4.1.1 was not CUDA enabled. I downloaded and built OpenCV 4.5 using the script here:

All went well, it installed, and CUDA is now enabled. However, it did not detect BLAS. I have scoured every forum and installed everything related to BLAS to no effect - the build does not detect it.

There is a suggestion that I build OpenBlas. However I see that Nvidia has an accelerated cuBLAS. So my question is: what is the best way to add BLAS to my OpenCV build? And are there any other accelerated libraries to use in place of standard libraries?

Thanks,
Colin

You would try adding -D WITH_CUBLAS=1 to your cmake options.

You would try adding -D WITH_CUBLAS=1 to your cmake options.

Thank you, I will try that. And could you tell me if cuBLAS is present by default in Jetpack or do I need to install it from somewhere?

Thanks again :-)

ref: nvblas for Jetson TX2 or another way to run Armadillo code with cublas - #5 by AastaLLL

It should be there. You may just check with:

sudo apt search cublas
Sorting... Done
Full Text Search... Done
libcublas-dev/unknown,stable,now 10.2.2.89-1 arm64 [installed,automatic]
  CUBLAS native dev links, headers

libcublas10/unknown,stable,now 10.2.2.89-1 arm64 [installed,automatic]
  CUBLAS native runtime libraries
...

It was there, as you describe, same version. Many thanks.

Colin

@colinalow
another handy tool to find a file with certain name on the local filesystem is `mlocate’

sudo apt install -y mlocate
 sudo updatedb
locate cublas | grep .so
/usr/lib/aarch64-linux-gnu/libcublas.so
/usr/lib/aarch64-linux-gnu/libcublas.so.10
/usr/lib/aarch64-linux-gnu/libcublas.so.10.2.2.89
/usr/lib/aarch64-linux-gnu/libcublasLt.so
/usr/lib/aarch64-linux-gnu/libcublasLt.so.10
/usr/lib/aarch64-linux-gnu/libcublasLt.so.10.2.2.89
/usr/lib/aarch64-linux-gnu/stubs/libcublas.so
/usr/lib/aarch64-linux-gnu/stubs/libcublasLt.so
/usr/local/cuda-10.2/doc/man/man7/libcublas.so.7
1 Like

Thanks for your help :-)