DriveWorks SDK Reference
3.5.78 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.2 QNX/Linux PDK installation for NVIDIA DRIVE in the Linux Host
  • CUDA cross-compilation libraries

To cross compile the DriveWorks SDK samples

  1. Verify that CUDA binaries for QNX are available on the host system under /usr/local/cuda-safe-<version>/. If they are missing please refer to the SDK Manager documentation.
  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-ga<version>/host/linux/x86_64

    Set the environment variable QNX_TARGET to path/to/sw/tools/embedded/qnx/qnx700-ga<version>/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/..

    Note
    Replace <version> with the actual version provided by the SDK Manager.
  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.3.1.3 \
          -DCUDA_DIR=/usr/local/cuda-safe-<version> /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.

    Note
    providing the full path to CUDA cross-compilation libraries via -DCUDA_DIR=/path/to/qnx/cuda/libraries is needed only if they are not installed under /usr/local/cuda

    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.