DriveWorks SDK Reference
4.0.0 Release
For Test and Development only

Cross-Compiling for NVIDIA DRIVE OS Linux

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

  • NVIDIA DriveWorks SDK Linux cross-compilation package
  • NVIDIA DRIVE® OS 5.2.6.0 Linux SDK/PDK
  • NVIDIA CUDA® Linux cross-compilation package

To Cross-Compile the NVIDIA DriveWorks SDK Samples

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

    $ sudo dpkg --add-architecture arm64
    $ sudo apt-get update
    $ sudo apt-get install cuda-cross-aarch64-10-2
    Note
    Some repositories may not have binaries for arm64, and apt-get update may cause some warnings. To prevent these warnings, edit /etc/apt/sources.list and files under /etc/apt/sources.list.d/ and add [arch=amd64,i386] after deb and before the URL to each line starting with deb. Ensure you specify amd64 and not arm64. For example, amend:
    deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
    to
    deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
  2. Install additional dependencies.
    $ sudo tee /etc/apt/sources.list.d/ubuntu-ports-arm64.list > /dev/null <<EOF
    deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports bionic main restricted
    deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports bionic-updates main restricted
    deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports bionic universe
    deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports bionic-updates universe
    deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports bionic multiverse
    deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports bionic-updates multiverse
    deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports bionic-backports main restricted universe multiverse
    deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports bionic-security main restricted
    deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports bionic-security universe
    deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports bionic-security multiverse
    EOF
    $ sudo apt-get update
    $ sudo apt-get -y --no-install-recommends install \
    libdrm-dev:arm64 \
    libegl1-mesa-dev:arm64 \
    libgl1-mesa-dev:arm64 \
    libgles2-mesa-dev:arm64 \
    libglu1-mesa-dev:arm64 \
    libusb-1.0-0:arm64 \
    libx11-dev:arm64 \
    libxcursor-dev:arm64 \
    libxinerama-dev:arm64 \
    libxrandr-dev:arm64 \
    libxxf86vm-dev:arm64 \
    x11proto-dev:arm64 \
    zlib1g-dev:arm64
  3. Configure the location of the NVIDIA DRIVE OS SDK/PDK:

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

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

    or define this location as a cmake command line argument:

    -DVIBRANTE_PDK:STRING=/path/to/drive-t186ref-linux
  4. Cross-compile.

    $ mkdir build
    $ cd build
    $ cmake -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_TOOLCHAIN_FILE=/path/to/driveworks/samples/cmake/Toolchain-V5L.cmake \
    -DVIBRANTE_PDK:STRING=/path/to/drive-t186ref-linux -DTRT_VERSION:STRING=6.5.0.7 \
    /usr/local/driveworks-4.0/samples
    $ make -j
    $ make install

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

    The build folder can be created anywhere in the system, however if it is outside of your home folder, you will probably need to run the commands with sudo.

Loading the Sample onto the NVIDIA DRIVE Platform

After cross-compiling your custom NVIDIA DriveWorks SDK sample on the Linux host system, you must load it to the target platform.

You can use automatic upload (recommended) or manually upload it.

The package-based installation will install libraries, binaries and resources into /usr/local/driveworks-4.0. However, if you build a custom NVIDIA DriveWorks SDK sample, you should upload those files to a separate directory such as:

/home/nvidia/driveworks

The above path assumes your user name is "nvidia". Of course, you would use a name more appropriate to your situation. Using this path rather than /usr/local/<name> avoids security constraints that can make the upload process more difficult.

Warning
The correct rpath for the binaries is set only during the make install step. As such, NVIDIA discourages copying binaries to the board without performing the make install step because this could] result in undefined behavior.

Automatic Upload (Recommended)

An upload target is provided as a convenience. Invoking this target uses rsync to sync the builds to a specified location on the device. target is set to depend on building and packaging.

The following cmake parameters configure the upload target:

  • VIBRANTE_HOST : IP address of the board, the default value is 192.168.0.10 for NVIDIA DRIVE Xavier A and 192.168.0.11 for NVIDIA DRIVE Xavier B.
  • VIBRANTE_INSTALL_PATH : destination folder of the compiled products. The default value is /home/nvidia/driveworks.
  • VIBRANTE_USER : Specifies the user that will be used to rsync the binaries. The default value is nvidia.
  • VIBRANTE_PASSWORD : Password for VIBRANTE_USER. The default value is nvidia.
  • VIBRANTE_PORT : Port on which ssh is listening on the target board. The default is 22.

To Invoke the Upload Target

On the Linux system, enter:

$ make upload
Note
If the VIBRANTE_HOST parameter is set to the IP address of a running NVIDIA DRIVE platform board, users can call the upload target to rsync the build folder with a folder on the board.

Manual Upload

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

On the host system, execute:

$ scp -r install/* nvidia@DPX_IP:/home/nvidia/<destination_dir>/