DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

Cross-Compiling for the NVIDIA DRIVE Platform (Linux)
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 OS 5.1 Linux SDK 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-aarch64-10-2
    
    Note
    Some repositories may not have binaries for arm64, and apt-get update may cause some errors. To prevent these errors, edit /etc/apt/sources.list and files under /etc/apt/sources.list.d/ and add [arch=amd64,i386] to 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-linux (NVIDIA DRIVE platform)
    

    -or-

    Define this location as a cmake parameter:

    -DVIBRANTE_PDK:STRING=/path/to/drive-t186ref-linux
    
  3. 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.3.1.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

After cross-compiling your custom DriveWorks 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 in /usr/local/driveworks-<version>. However, if you build a custom DriveWorks 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.

Note
Important: The correct rpath for the binaries is set only during installation. As such, NVIDIA discourages copying pre-install binaries to the board 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 Xavier A and 192.168.0.11 for 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>/