DriveWorks SDK Reference
3.0.4260 Release
For Test and Development only

Cross-Compiling for the NVIDIA DRIVE Platform (QNX)
Note
SW Release Applicability: This sample is available in both NVIDIA DriveWorks and NVIDIA DRIVE Software releases.

To compile the samples or any user code using NVIDIA® DriveWorks, you must use cross-compilation from a Linux host. For this, in addition to the requirements above, you must have the additional components:

  • DriveWorks SDK cross-compilation package
  • NVIDIA DRIVE 5.1 QNX/Linux PDK installation for NVIDIA DRIVE in the Linux Host
  • CUDA cross-compilation libraries

To cross compile the DriveWorks SDK samples

  1. On the host system, install CUDA cross-compilation libraries.

    $ sudo dpkg --add-architecture arm64
    $ sudo apt-get update
    $ sudo apt-get install cuda-cross-qnx-10-2
    
    Note
    Some repositories may not have binaries for arm64 and apt-get update causes errors. To prevent these errors, edit /etc/apt/sources.list and files under /etc/apt/sources.list.d/ and add [arch=amd64,i386] into each line starting with deb. Ensure you specify amd64 and not arm64.
  2. Configure the location of the NVIDIA DRIVE SDK/PDK.

    Set the environment variable DriveSDK to point to the SDK/PDK folders:

    /path/to/drive-t186ref-qnx (NVIDIA DRIVE platform)
    

    -or-

    Define this location as a cmake parameter:

    -DVIBRANTE_PDK:STRING=/path/to/drive-t186ref-qnx
    

    Set the environment variable QNX_HOST to path/to/sw/tools/embedded/qnx/qnx700-ga1/host/linux/x86_64

    Set the environment variable QNX_TARGET to path/to/sw/tools/embedded/qnx/qnx700-ga1/target/qnx7

    Set the environment variable QNX_BASE to path/to/drive-t186ref-qnx/targetfs

    Set the environment variable QNX_TOP to path/to/drive-t186ref-qnx/..

  3. Cross-compile.

    $ mkdir build
    $ cd build
    $ cmake -DCMAKE_BUILD_TYPE=Release \
          -DCMAKE_TOOLCHAIN_FILE=/path/to/driveworks/samples/cmake/Toolchain-V5Q.cmake \
          -DVIBRANTE_PDK:STRING=/path/to/drive-t186ref-qnx -DTRT_VERSION:STRING=6.2.0.3 \
           /path/to/driveworks/samples/folder
    $ make -j
    $ make install
    

    To streamline the deploy process, you can set the cmake definitions as environment variables.

    Also the build folder can be created anywhere in the system, however if it's outside of your home folder, you'll probably need to run the next commands with sudo.

Loading the Sample on the NVIDIA DRIVE Platform

When you manually upload the sample to the target device, you copy the cross- compiled binaries to a device with IP AGX_IP as user root.

On the host system, execute:

    $ scp -r install/* root@AGX_IP:/mnt/<destination_dir>/
Note
on DRIVE QNX there is no home folder. If you followed the instruction at Installation on NVIDIA DRIVE Platform (QNX) you can use the /mnt folder instead.