How to compile NvMedia samples for host machine?

Hi,

I’m developing applications that utilize some NvMedia module. Unlike DriveWorks, it seems NvMedia samples from Drive OS can only be compiled for target machine. After following section “Building and Running the NvMedia Samples” in “NVIDIA DRIVE Software Development Guide 10.0 Release”, the sample application compiled are build for target architecture. For example:

$file nvmvid_cap
nvmvid_cap: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-, for GNU/Linux 3.7.0…

I don’t see any option for compiling for host machine here.
If I copy the source code to DriveWorks samples, then I can compile for host machine, but I cannot include NvMedia library.

in NvMedia.h (DriveWorks/targets/x86_64-Linux/include/dw/core/NvMedia.h), all these NvMedia header files will only be included if “VIBRANTE” is defined, and “VIBRANTE” is not defined in the toolchain for host machine.

Is there any way I can test NvMedia API on a host machines? please advise.

Thank you

1 Like

Hi James22,

NvMedia samples is intended for demonstrating hardware acceleration across NVIDIA Tegra devices so there is no support for compiling and running for host system.

Could you please let us know why you need to run nvmedia samples on host system? Thanks!

The purpose is to develop applications that uses NvMedia APIs. Since DriveWorks samples/applications can be compiled for both host and machines, I hope to call NvMedia API directly. (e.g. use the virtual camera from DriveWorks, then converted captured image into NvMedia image, then use NvMedia to do some processing on it) Currently it’s only possible if I cross-compile it for target, but it’s not convenient for development.

It doesn’t have to be NvMedia samples, if NvMedia APIs can be called from DriveWorks samples, that also works. Ultimately what I’m looking for is running application that uses NvMedia APIs on the host machine, as it makes debugging much easier.

Please help try if below libraries are applicable to your usage. Some DriveWorks samples use them for x86-64 build.

/usr/local/driveworks/targets/x86_64-Linux/lib/libnvmedia_isc.so
/usr/local/driveworks/targets/x86_64-Linux/lib/libnvmedia_acp.so
/usr/local/driveworks/targets/x86_64-Linux/lib/libnvmedia_ipp.so
/usr/local/driveworks/targets/x86_64-Linux/lib/libnvmediabbfldr.so
/usr/local/driveworks/targets/x86_64-Linux/lib/libnvmedia_isp.so
/usr/local/driveworks/targets/x86_64-Linux/lib/libnvmedia.so

Thank you VickNV, it seems the APIs I’m looking for are included in these libraries.
Could you give a hint on how can I include these libraries using Cmake files that come with DriveWorks samples? so I can reuse the DriveWorks sample frameworks.

I’m not sure how’s the functionality and if it can really simplify your development process. But if you want to try, you can refer to /usr/local/driveworks/samples/cmake/IncludeTargetDirectories.cmake in your host system.

Hi VcikNV, Thanks for the help!
Right now the problem I’m encountering is I don’t have the right nvmedia header files for x86 platform.
I tried to copy the nvmedia header files from target file system and included them, then I got errors like:

error: using typedef-name ‘NvMediaDevice’ after ‘struct’
typedef struct NvMediaDevice NvMediaDevice;

note: ‘NvMediaDevice’ has a previous declaration here
typedef void NvMediaDevice;

Since in a number of places ‘NvMediaDevice’ was defined as ‘void’ in the x86 header files (e.g. NvMedia.g in /usr/local/driveworks/targets/x86_64-Linux/include/dw/core), I guess the header files for target are not compilable.

If I want to call a function that’s in /usr/local/driveworks/targets/x86_64-Linux/lib/libnvmedia.so, which header file should I use? Since these functions are not included in /usr/local/driveworks/targets/x86_64-Linux/include/dw/core/NvMedia.h.

Could you point out the code snippet where ‘NvMediaDevice’ was defined as ‘void’?

I think you should use files under /usr/local/driveworks-2.2/targets/x86_64-Linux directory.

In line 66 of NvMedia.h ( /usr/local/driveworks/targets/x86_64-Linux/include/dw/core)
//typedef void NvMediaDevice;

Just noticed this line was removed in Drive Software 10.0. I will look into if the behavior would be different on host machine that runs Drive Software 10.0.

“typedef void NvMediaDevice;” is located in nvmedia_core.h line 305

@VickNV could you please describe the steps needed to run an application that uses NvMedia APIs on the host machine?

Reading your above comments, looks like there are appropriate x86-64 libnvmedia*.so files and something about refer to a cmake file. That looks promising, so can you please expand on this?

Thanks!

Dear @sleff,
NvMedia library works only on target. There is no NvMedia libs for host

1 Like

@SivaRamaKrishnaNV although this is not my topic, I think you could mark your above answer as the solution.

1 Like