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:
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
/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
.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
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.
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.
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.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
.On the Linux system, enter:
$ make upload
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.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>/