Setting Up Networking on the Host and Target
Use the information in this topic to set up the network between an Ubuntu host and your NVIDIA DRIVE platform. The steps to set up networking includes configuring networking on the host computer, configuring the DHCP and NFS server, and configuring networking on the target.
Configuring the Network Interface
Configuring the network interface for your device requires:
Connecting the board to the host Linux development system.
If you have installed and configured Minicom for your board, configuring the network interface is optional.
Configuring the network interface.
Connecting the Target to the Host Using the Network Interface
Use the procedures to connect your target board to the Linux Ubuntu host machine using a private LAN. This private LAN is not the LAN connecting the host to the Internet. The methods to connect include:
USB-to-Ethernet dongle-type adapter
Through Onboard 100 Mb/1Gb HSD connectors
Note:
To avoid auto detection conflicts with the adapter, do not configure these items with the network manager.
To use USB-to-Ethernet to connect the board and host on the private LAN
1. If using a USB-to-Ethernet dongle-type adapter on the host, plug the first USB-to-Ethernet adapter (Dlink DUB-E100) USB type A male end into a USB type A female jack on the host and plug/connect one end of CAT-6 crossover cable to RJ45 port. If using an additional on-board or PCIe-based Ethernet NIC, then connect one end of CAT-6 crossover cable to RJ45 port of the NIC.
2. Plug the other male end of the CAT-6 crossover into the RJ45 jack of a second USB-to-Ethernet adapter (Dlink DUB-E100).
3. Plug the USB type A male end of the adapter into the designated USB type A female jack on the target.
 
Note:
If an USB-to-Ethernet dongle is plugged into the system, then the Ethernet interface mapped to the Xavier EQOS controller and the USB-to-Ethernet adapter is unpredictable. In most instances, the EQOS controller is enumerated as eth0 (which is the desired outcome), but in some instances, the USB-to-Ethernet adapter instead is enumerated as eth0.
This unpredictability may cause rootfs mount failures when booting over NFS. The NFS boot logic in Yocto initramfs relies on the USB-to-Ethernet adapter being enumerated as eth1.
To use onboard HSD connector to connect the board and host on the private LAN
1. To use onboard 100Mb/1Gb HSD connector, one HSD to RJ45 dongle is required along with one HSD cable.
2. Connect one end of HSD cable to one of the 100Mb/1Gb HSD ports of the target and other end to HSD to RJ45 dongle.
3. Obtain a CAT-6 crossover patch cable and plug one of the RJ45 male ends into the RJ45 of HSD to RJ45 dongle.
4. Plug the other male end of the CAT-6 crossover patch cable into the RJ45 port of HOST machine or to RJ45 port of USB2-to-Ethernet adapter (Dlink DUB-E100) connected on your host machine.
Note:
Consult Connecting the platform to locate the 100Mb/1Gb HSD target ports.
Configuring the Private LAN to the Target Network
Use the following procedure to configure the host interface for the private LAN connected to the target platform. The procedure assumes eth1 is the Ethernet port on the host PC connected to the NVIDIA board.
To configure the private LAN to the target
1. Determine which host eth<n> port is connected to the target, where <n> is the port instance.
Find the eth device with the following command:
dmesg | grep -i eth
In the grep results, identify the eth<n> port for the smsc95xx or similar USB Ethernet adapter.
For example, the following dmesg result indicates that the eth1 port is connected to the target:
[1310932.166153] smsc95xx 2-5.1:1.0: eth1: register 'smsc95xx' at usb-0000:00:1d.7-5.1, smsc95xx USB 2.0 Ethernet, 00:04:4b:1b:32:6b
2. On the host, find and edit the following file:
/etc/network/interfaces
This file is read-only, so you must open it with administrative privileges, for example:
sudo vim /etc/network/interfaces
3. Depending on your connection to the target, modify the interfaces file:
Additional NIC card/adapter: Add the following to the interfaces file:
auto eth1
iface eth1 inet static
address 10.0.0.1
netmask 255.255.255.0
USB Ethernet adapter: Add the following to the interfaces file:
auto eth1
allow-hotplug eth1
iface eth1 inet static
address 10.0.0.1
netmask 255.255.255.0
post-up /etc/init.d/isc-dhcp-server restart
4. Restart the host’s networking with the following command:
sudo /etc/init.d/networking restart
5. Hard reboot the host system.
Configuring the DHCP and NFS Server on the Host
The DHCP server on the host is used to assign the IP address to the target board and the NFS server is used to mount the root file system on the NVIDIA target board using NFS.
If the DHCP and NFS servers are not yet installed on the host, the installer installs and configures them. Alternatively, those servers can be installed and configured as follows.
To set the DHCP server
1. Install the DHCP server on the host:
sudo apt-get install isc-dhcp-server
2. Specify the interface on which the server should listen for leasing an IP address from the target over the private LAN.
Locate and edit the following file:
/etc/default/isc-dhcp-server
This file is read-only, so you must open it with administrator privileges.
Modify the isc-dhcp-server file to set INTERFACES to the eth<n> connection you determined when connecting your network interface.
For example, add the following line if the DHCP server should listen on eth1 interface.
INTERFACES="eth1"
Changing the interface to “eth3” can result in the following error:
udevd[148]: error changing net interface name eth0 to eth3: Device or resource busy
To resolve this error, delete the /etc/udev/rules.d/70-persistent-net.rules file.
3. Configure your host DHCP server for the target interface.
Locate and edit the following file:
/etc/dhcp/dhcpd.conf
Because the file is read-only, open it with administrator privileges.
Modify the dhcpd.conf file to contain the following:
ddns-update-style none;
allow bootp;
subnet 10.0.0.0 netmask 255.255.255.0 {
option routers 10.0.0.1;
option domain-name <domain_name>;
option domain-name-servers <DNS1>, <DNS2>, ... ;
default-lease-time 345600;
max-lease-time 31557600;
range 10.0.0.2 10.0.0.254;
option root-path "10.0.0.1:/<top>/drive-t186ref-linux/targetfs,wsize=8192,rsize=8192,v3";
}
Where:
<domain_name> is your company domain name.
<DNS1>, <DNS2> are the DNS servers that you already added to the /etc/resolv.conf file on your host system. Multiple DNS servers are separated by commas. For example, the Google public DNS IP addresses are formatted as:
8.8.8.8, 8.8.4.4
4. Restart the DHCP server:
sudo /etc/init.d/isc-dhcp-server restart
To set the NFS server
1. Install the NFS server on the host using apt-get:
sudo apt-get install nfs-kernel-server nfs-common portmap
2. Locate and edit the following file:
/etc/exports
Add the corresponding path to the target file system:
<top>/drive-t186ref-linux *(async,rw,no_root_squash,no_all_squash,no_subtree_check)
This change exports the target file system.
3. Restart the NFS server:
sudo /etc/init.d/nfs-kernel-server restart
sudo exportfs -a
Enabling Internet Access from the Target
The target file system is apt-get compatible. With Internet access on the target system, download and install additional packages using apt-get directly from the Ubuntu server (Ubuntu ARM port).
Note:
Online versions can change, therefore, it cannot be guaranteed that the latest server from the online repository works with the product.
For releases supporting X Windows
For X installations, the board must be booted before attempting to setup Internet connectivity. This ensures that the X server and other packages are installed from the local repository instead of online.
To enable Internet access from the target
1. On the Linux host, enter these commands to enable settings on the host:
$ sudo sysctl -w net.ipv4.ip_forward=1
$ sudo iptables -F
$ sudo iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
Where eth1 is the interface connected to the network that is connected to the Internet on the host.
$ sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Where eth0 is the private LAN interface connected to target from the host.
2. On the target, enter these commands to enable settings on the target device:
$ sudo ip route add default via 10.0.0.1
$ dhclient <ethernet interface>
Where 10.0.0.1 is the IP address of the host as seen from the target.
The dhclient command also generates the name server configuration in the file:
/etc/resolv.conf
Note:
While attempting to enable Internet access on an NFS mounted system and the dhclient initially fails or hangs, manually add an /etc/resolv.conf file.
For more information, contact your NVIDIA Technical Support Engineer.
3. On the target, resynchronize the package index files with this command:
apt-get update
Configuring the Host System to Run DriveWorks Samples
For best practices, run the DriveWorks samples from the home directory instead of using /usr/local/driveworks/ directory. Keep /usr/local/driveworks/ as a reference copy backup.
Setting Up DriveWorks samples on the Linux Host
Use these steps to compile and cross-compile from the home directory, and run the binaries from the home directory.
To enable compiling and cross-compiling using the home directory
1. Create a DriveWorks samples directory. For example:
mkdir /home/nvidia/dw_samples
2. Navigate to the newly created directory.
cd /home/nvidia/dw_samples
3. Execute the link command to link cmake and build the samples from the usr/local/ directory:
ln -s /usr/local/driveworks/samples/cmake/ cmake
4. Execute the link command once again to link the 3rdparty directory.
ln -s /usr/local/driveworks/samples/3rdparty/ 3rdparty
5. Copy the samples source and by executing the command:
cp -r /usr/local/driveworks/samples/src .
6. Copy the CMakeLists.txt file by executing the command:
cp /usr/local/driveworks/samples/CMakeLists.txt .
To run the binaries from the home directory:
Use a text editor to modify the CMakeLists.txt file to set the DriveWorks data path. For example:
vi CMakeLists.txt
set(DRIVEWORKS_DATAPATH “/usr/local/driveworks/data”)