Cannot link: /usr/bin/ld: cannot find -lnvbuf_utils

This is on an industrial grade AGX running JetPack 4.4 (see below).

We have Jetson Interference built from source and our code is in cpp. When attemting to build, the linker fails with:"/usr/bin/ld: cannot find -lnvbuf_utils"

The same configuration builds and runs on an NX (though I don’t recall which version of Jetpack is on that computer).

Package: nvidia-jetpack
Version: 4.4.1-b50
Priority: standard
Section: metapackages
Maintainer: NVIDIA Corporation
Installed-Size: 199 kB
Depends: nvidia-cuda (= 4.4.1-b50), nvidia-opencv (= 4.4.1-b50), nvidia-cudnn8 (= 4.4.1-b50), nvidia-tensorrt (= 4.4.1-b50), nvidia-visionworks (= 4.4.1-b50), nvidia-container (= 4.4.1-b50), nvidia-vpi (= 4.4.1-b50), nvidia-l4t-jetson-multimedia-api (>> 32.4-0), nvidia-l4t-jetson-multimedia-api (<< 32.5-0)
Homepage: Autonomous Machines | NVIDIA Developer
Download-Size: 29.4 kB
APT-Sources: https://repo.download.nvidia.com/jetson/t194 r32.4/main arm64 Packages
Description: NVIDIA Jetpack Meta Package

Do you have jetson-multimedia-api installed ?

sudo apt search nvidia-l4t-jetson-multimedia-api

If not, install it.

If yes, does adding /usr/lib/aarch64-linux-gnu/tegra into LD_LIBRARY_PATH helps ?

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/aarch64-linux-gnu/tegra

# Assuming you're running this in the build directory where your built app is:
./your_app

If still not working, post the output of:

ldd ./your_app

(post deleted by author)

Yes, the multimedia-api is installed, exporting the LD_LIBRARY_PATH didn’t help, I see the libnvbuf_utils.so file in the /usr/lib/aarch64-linux-gnu/tegra directory, my app fails to build because of the linking error so I can’t really run a ldd on it.

1 Like

This is the same problem on the AGX dev kit not just the industrial AGX. On NX it runs fine

Yes, the multimedia-api is installed, exporting the LD_LIBRARY_PATH didn’t help, I see the libnvbuf_utils.so file in the /usr/lib/aarch64-linux-gnu/tegra directory, my app fails to build because of the linking error so I can’t really run a ldd on it.

You would try adding:

-L /usr/lib/aarch64-linux-gnu/tegra 

into your build flags.

Thanks @Honey_Patouceul - or if you are using CMake, add link_directories(/usr/lib/aarch64-linux-gnu/tegra) to your CMakeLists.txt

Thanks @dusty_nv this worked and we can close this issue but I’m still curious why this wasn’t necessary on the NX and only on the AGX this was an issue.

I’m not entirely sure either, and I’m also still trying to figure out why CMake would need this link_directories() command added in other CMakeLists that aren’t building the jetson-inference/jetson-utils library itself.

If the library is in the default search path it should be automatically found, but if not in the default search path, then you’d need to manually name it. I saw this handy method of printing the default path from stackoverflow.com:

ld --verbose | grep SEARCH_DIR | tr -s ' ;' \\012

Did that command list “/usr/lib/aarch64-linux-gnu/tegra”? If not, then you could examine the files in “/etc/ld.so.conf.d/*.conf” which adds to the default linker path. Perhaps one of the “.deb” packages sets up linker paths in one case, but not in another case.