Linking Visionworks in a CMakeLists.txt file

Hi everyone,

after having gone through the Visionworks samples, I am a little stuck trying to understand how linking against the Visionworks library works. I am working on a Jetson TX1 with Visionworks installed. I was able to successfully build all the Visionworks samples.

Now I am looking for a way to include the nvxio library in my standalone code, however, I am unsure what I have to set up in my CMakeLists.txt file. I would imagine, I have to first find_package the library and then include it in the include_directories and lastly link against it with link_directories.

Are there any examples for doing this available? The Makefiles are overly complicated and I am not sure I fully understand what they are doing and how everything needs to be set up for this to work. Do I need to copy the nvxio folder into my CMakeSourceDirectory?

Sorry if this is a very obvious/simple question…

Thanks I appreciate any input/help!

Marc

Hi MarcGy,

Have you checked the VisionWorks?
http://developer.nvidia.com/embedded/dlc/visionworks-1-4-documentation-for-l4t-24-1

Supposed you can find useful information from there.

Cheers

kayccc,
I’ve installed JetPack 2.3 to my Desktop & TK1 board.

My TK1 setup:

$ dpkg -l libvisionworks*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                               Version                Architecture           Description
+++-==================================-======================-======================-=========================================================================
ii  libvisionworks                     1.4.3                  armhf                  NVIDIA's VisionWorks Library and supplemental data
ii  libvisionworks-dev                 1.4.3                  all                    Development files for NVIDIA's VisionWorks Library
ii  libvisionworks-docs                1.4.3                  all                    Documentation for NVIDIA's VisionWorks Library
ii  libvisionworks-repo                1.4.3                  armhf                  NVIDIA VisionWorks computer vision library.
ii  libvisionworks-samples             1.4.3                  armhf                  Samples for NVIDIA's VisionWorks Library
ii  libvisionworks-sfm                 0.86.2                 armhf                  SFM module for NVIDIA's VisionWorks Library
ii  libvisionworks-sfm-dev             0.86.2                 armhf                  Development files for SFM module for NVIDIA's VisionWorks Library
ii  libvisionworks-sfm-docs            0.86.2                 all                    Documentation for SFM module for NVIDIA's VisionWorks Library
ii  libvisionworks-sfm-repo            0.86.2                 armhf                  Package repository for NVIDIA's VisionWorks SFM module.
ii  libvisionworks-tracking            0.82.3                 armhf                  Tracking module for NVIDIA's VisionWorks Library
ii  libvisionworks-tracking-dev        0.82.3                 armhf                  Development files for Tracking module for NVIDIA's VisionWorks Library
ii  libvisionworks-tracking-docs       0.82.3                 all                    Documentation for Tracking module for NVIDIA's VisionWorks Library
ii  libvisionworks-tracking-repo       0.82.3                 armhf                  Package repository for NVIDIA's VisionWorks Tracking module.
$ dpkg -l cuda* | grep ^ii
ii  cuda-command-line-tools-6-5                           6.5-53                                              armhf        CUDA command-line tools
ii  cuda-core-6-5                                         6.5-53                                              armhf        CUDA core tools
ii  cuda-cublas-6-5                                       6.5-53                                              armhf        CUBLAS native runtime libraries
ii  cuda-cublas-dev-6-5                                   6.5-53                                              armhf        CUBLAS native dev links, headers
ii  cuda-cudart-6-5                                       6.5-53                                              armhf        CUDA Runtime native Libraries
ii  cuda-cudart-dev-6-5                                   6.5-53                                              armhf        CUDA Runtime native dev links, headers
ii  cuda-cufft-6-5                                        6.5-53                                              armhf        CUFFT native runtime libraries
ii  cuda-cufft-dev-6-5                                    6.5-53                                              armhf        CUFFT native dev links, headers
ii  cuda-curand-6-5                                       6.5-53                                              armhf        CURAND native runtime libraries
ii  cuda-curand-dev-6-5                                   6.5-53                                              armhf        CURAND native dev links, headers
ii  cuda-cusolver-6-5                                     6.5-53                                              armhf        CUDA solver native runtime libraries
ii  cuda-cusolver-dev-6-5                                 6.5-53                                              armhf        CUDA solver native dev links, headers
ii  cuda-cusparse-6-5                                     6.5-53                                              armhf        CUSPARSE native runtime libraries
ii  cuda-cusparse-dev-6-5                                 6.5-53                                              armhf        CUSPARSE native dev links, headers
ii  cuda-documentation-6-5                                6.5-53                                              armhf        CUDA documentation
ii  cuda-driver-dev-6-5                                   6.5-53                                              armhf        CUDA Driver native dev stub library
ii  cuda-license-6-5                                      6.5-53                                              armhf        CUDA licenses
ii  cuda-misc-headers-6-5                                 6.5-53                                              armhf        CUDA misc headers
ii  cuda-npp-6-5                                          6.5-53                                              armhf        NPP native runtime libraries
ii  cuda-npp-dev-6-5                                      6.5-53                                              armhf        NPP native dev links, headers
ii  cuda-repo-l4t-r21.5-6-5-local                         6.5-53                                              armhf        CUDA repo configuration files.
ii  cuda-samples-6-5                                      6.5-53                                              armhf        CUDA example applications
ii  cuda-toolkit-6-5                                      6.5-53                                              armhf        CUDA Toolkit 6.5 meta-package
$ ldd /usr/lib/libvisionworks.so
        libcudart.so.6.5 => /usr/local/cuda-6.5/lib/libcudart.so.6.5 (0xb6931000)
        libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb68fa000)
        libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb68ef000)
        librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xb68e1000)
        libstdc++.so.6 => /home/roma/lib/libstdc++.so.6 (0xb6822000)
        libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb67b6000)
        libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6794000)
        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb66ad000)
        /lib/ld-linux-armhf.so.3 (0xb6f41000)

My Desktop setup:

$ dpkg -l libvisionworks*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                               Version                Architecture           Description
+++-==================================-======================-======================-=========================================================================
ii  libvisionworks                     1.5.3.55n              amd64                  NVIDIA's VisionWorks Library and supplemental data
ii  libvisionworks-dev                 1.5.3.55n              all                    Development files for NVIDIA's VisionWorks Library
ii  libvisionworks-docs                1.5.3.55n              all                    Documentation for NVIDIA's VisionWorks Library
ii  libvisionworks-nvxio               1.5.3.55n              amd64                  NVIDIA's VisionWorks Library and supplemental data
ii  libvisionworks-nvxio-dev           1.5.3.55n              all                    NVIDIA's VisionWorks Library and supplemental data
ii  libvisionworks-repo                1.5.3.55n              amd64                  NVIDIA VisionWorks computer vision library.
ii  libvisionworks-samples             1.5.3.55n              amd64                  Samples for NVIDIA's VisionWorks Library
ii  libvisionworks-sfm                 0.88.0                 amd64                  SFM module for NVIDIA's VisionWorks Library
ii  libvisionworks-sfm-dev             0.88.0                 amd64                  Development files for SFM module for NVIDIA's VisionWorks Library
ii  libvisionworks-sfm-docs            0.88.0                 all                    Documentation for SFM module for NVIDIA's VisionWorks Library
ii  libvisionworks-sfm-repo            0.88.0                 amd64                  Package repository for NVIDIA's VisionWorks SFM module.
ii  libvisionworks-tracking            0.84.0                 amd64                  Tracking module for NVIDIA's VisionWorks Library
ii  libvisionworks-tracking-dev        0.84.0                 amd64                  Development files for Tracking module for NVIDIA's VisionWorks Library
ii  libvisionworks-tracking-docs       0.84.0                 all                    Documentation for Tracking module for NVIDIA's VisionWorks Library
ii  libvisionworks-tracking-repo       0.84.0                 amd64                  Package repository for NVIDIA's VisionWorks Tracking module.
$ dpkg -l cuda* | grep ^ii
ii  cuda-command-line-tools-6-5    6.5-53       amd64        CUDA command-line tools
ii  cuda-core-6-5                  6.5-53       amd64        CUDA core tools
ii  cuda-cublas-6-5                6.5-53       amd64        CUBLAS native runtime libraries
ii  cuda-cublas-dev-6-5            6.5-53       amd64        CUBLAS native dev links, headers
ii  cuda-cudart-6-5                6.5-53       amd64        CUDA Runtime native Libraries
ii  cuda-cudart-dev-6-5            6.5-53       amd64        CUDA Runtime native dev links, headers
ii  cuda-cufft-6-5                 6.5-53       amd64        CUFFT native runtime libraries
ii  cuda-cufft-dev-6-5             6.5-53       amd64        CUFFT native dev links, headers
ii  cuda-curand-6-5                6.5-53       amd64        CURAND native runtime libraries
ii  cuda-curand-dev-6-5            6.5-53       amd64        CURAND native dev links, headers
ii  cuda-cusparse-6-5              6.5-53       amd64        CUSPARSE native runtime libraries
ii  cuda-cusparse-dev-6-5          6.5-53       amd64        CUSPARSE native dev links, headers
ii  cuda-documentation-6-5         6.5-53       amd64        CUDA documentation
ii  cuda-driver-dev-6-5            6.5-53       amd64        CUDA Driver native dev stub library
ii  cuda-license-6-5               6.5-53       amd64        CUDA licenses
ii  cuda-misc-headers-6-5          6.5-53       amd64        CUDA misc headers
ii  cuda-npp-6-5                   6.5-53       amd64        NPP native runtime libraries
ii  cuda-npp-dev-6-5               6.5-53       amd64        NPP native dev links, headers
ii  cuda-repo-ubuntu1404-6-5-local 6.5-53       amd64        CUDA repo configuration files.
ii  cuda-samples-6-5               6.5-53       amd64        CUDA example applications
ii  cuda-toolkit-6-5               6.5-53       amd64        CUDA Toolkit 6.5 meta-package
ii  cuda-visual-tools-6-5          6.5-53       amd64        CUDA visual tools

But visionworks library is compiled against cuda-8.0:

$ ldd /usr/lib/libvisionworks.so
        linux-vdso.so.1 =>  (0x00007ffdc30ee000)
        libcudart.so.8.0 => not found
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9cb5eee000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9cb5ce9000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f9cb5ae1000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f9cb575f000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9cb5455000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f9cb523f000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9cb4e76000)
        /lib64/ld-linux-x86-64.so.2 (0x000055d0f5feb000)

I can see the JetPack 2.3 contains different visionworks versions for armhf and amd64 targets. Is it possible to include the same VisionWorks versions for armhf & amd64 in the JetPack distro?

I also tried http://developer.download.nvidia.com/devzone/devcenter/mobile/jetpack_l4t/003/linux-x64/libvisionworks-repo_1.4.3_amd64_ubuntu-14.04.deb from JetPack 2.2.1 but it’s linked against cuda-7-0.
Unfortunately I can’t start JetPack-2.2 installer since it requires Ubuntu 14, but I’m running 16.
Where may I get the VisionWorks for amd64 built against cuda-6.5?

Also I can’t find nvxio package for armhf.

Well, could you please rebuild libvisionworks-1.5 against cuda-6-5 for amd64 and armhf for TK1 please.
Would be nice to have it in the next JetPack release.
Thanks!

Also would be nice to have it compiled with C++11 gcc ABI.

Hi romanr2,

We do not offer the 64-bit user space and runtime libraries for TK1, and the JetPack also only run on 32-bit Ubuntu 14.04.
You may need to manage to use a virtual machine with ubuntu 14.04 instead of real host.

Thanks

Hi kayccc,
Thanks for reply.
Let me clarify:

I need libvisionworks-1.5 with nvxio compiled for ARM 32-bit linked against cuda-6-5 witn C++11 ABI enabled.

Thanks.

Hi romanr2,

Sorry, we don’t have 32 bit version for TX1 now.