DriveWorks SDK Reference
3.0.4260 Release
For Test and Development only

/dvs/git/dirty/gitlab-master_av/dw/sdk/doc/tutorials/samples/V5L.md
Go to the documentation of this file.
1 # Copyright (c) 2019-2020 NVIDIA CORPORATION. All rights reserved.
2 
3 @page dwx_samples_building_V5L Cross-Compiling for the NVIDIA DRIVE Platform (Linux)
4 
5 @note SW Release Applicability: This sample is available in both **NVIDIA DriveWorks** and **NVIDIA DRIVE Software** releases.
6 
7 To compile the samples or any user code using NVIDIA<sup>&reg;</sup> DriveWorks, you must use
8 cross-compilation from a Linux host. For this, in addition to the requirements
9 above, you must have the additional components:
10 
11 - DriveWorks SDK cross-compilation package
12 - NVIDIA DRIVE OS 5.1 Linux SDK installation for NVIDIA DRIVE in the Linux Host
13 - CUDA cross-compilation libraries
14 
15 ## To cross compile the DriveWorks SDK samples
16 
17 1. On the host system, install CUDA cross-compilation libraries.
18 
19  $ sudo dpkg --add-architecture arm64
20  $ sudo apt-get update
21  $ sudo apt-get install cuda-cross-aarch64-10-2
22 
23  @note Some repositories may not have binaries for arm64, and apt-get
24  update may cause some errors. To prevent these errors, edit
25  `/etc/apt/sources.list` and files under `/etc/apt/sources.list.d/` and add
26  `[arch=amd64,i386]` to each line starting with `deb`. Ensure you specify
27  `amd64` and not `arm64`.
28 
29 2. Configure the location of the NVIDIA DRIVE SDK/PDK.
30 
31  Set the environment variable `DriveSDK` to point to the SDK/PDK folders:
32 
33  /path/to/drive-t186ref-linux (NVIDIA DRIVE platform)
34 
35  -or-
36 
37  Define this location as a `cmake` parameter:
38 
39  -DVIBRANTE_PDK:STRING=/path/to/drive-t186ref-linux
40 
41 3. Cross-compile.
42 
43  $ mkdir build
44  $ cd build
45  $ cmake -DCMAKE_BUILD_TYPE=Release \
46  -DCMAKE_TOOLCHAIN_FILE=/path/to/driveworks/samples/cmake/Toolchain-V5L.cmake \
47  -DVIBRANTE_PDK:STRING=/path/to/drive-t186ref-linux -DTRT_VERSION:STRING=6.2.0.3 \
48  /path/to/driveworks/samples/folder
49  $ make -j
50  $ make install
51 
52  To streamline the deploy process, you can set the `cmake` definitions as
53  environment variables.
54 
55  Also the build folder can be created anywhere in the system, however if it's outside
56  of your home folder, you'll probably need to run the next commands with **sudo**.
57 
58 ## Loading the Sample on the NVIDIA DRIVE Platform
59 
60 After cross-compiling your custom DriveWorks sample on the Linux host
61 system, you must load it to the target platform.
62 You can use automatic upload (recommended) or manually upload it.
63 
64 The package-based installation will install libraries, binaries and resources in
65 `/usr/local/driveworks-<version>`. However, if you build a custom DriveWorks
66 sample, you should upload those files to a separate directory such as:
67 
68  /home/nvidia/driveworks
69 
70 The above path assumes your user name is "nvidia". Of course, you would use
71 a name more appropriate to your situation. Using this path rather than
72 `/usr/local/<name>` avoids security constraints that can make the upload process
73 more difficult.
74 
75 @note *Important*: The correct `rpath` for the binaries is set only during
76 installation. As such, NVIDIA discourages copying pre-install binaries to the
77 board because this could result in undefined behavior.
78 
79 ### Automatic Upload (Recommended)
80 
81 An `upload` target is provided as a convenience. Invoking this target uses
82 `rsync` to sync the builds to a specified location on the device. `target` is
83 set to depend on building and packaging.
84 
85 The following cmake parameters configure the `upload` target:
86 
87 * `VIBRANTE_HOST` : IP address of the board, the default value is
88  `192.168.0.10` for Xavier A and `192.168.0.11` for Xavier B.
89 * `VIBRANTE_INSTALL_PATH` : destination folder of the compiled products. The
90  default value is `/home/nvidia/driveworks`.
91 * `VIBRANTE_USER` : Specifies the user that will be used to `rsync` the
92  binaries. The default value is `nvidia`.
93 * `VIBRANTE_PASSWORD` : Password for `VIBRANTE_USER`. The default value is
94  `nvidia`.
95 * `VIBRANTE_PORT` : Port on which `ssh` is listening on the target board. The
96  default is `22`.
97 
98 #### To invoke the upload target
99 
100 On the Linux system, enter:
101 
102  $ make upload
103 
104 @note If the `VIBRANTE_HOST` parameter is set to the IP address of a running
105 NVIDIA DRIVE platform board, users can call the upload target to `rsync` the build folder
106 with a folder on the board.
107 
108 ### Manual Upload
109 
110 When you manually upload the sample to the target device, you copy the cross-
111 compiled binaries to a device with IP `DPX_IP` as user `nvidia`.
112 
113 On the host system, execute:
114 
115  $ scp -r install/* nvidia@DPX_IP:/home/nvidia/<destination_dir>/