NVIDIA Tegra
NVIDIA DRIVE OS 5.1 Linux SDK

Developer Guide
5.1.6.0 Release


 
Display Server Application
 
Configuring displayserver
Usage Examples
NVIDIA® Tegra™ code-named Xavier processor has one display controller unit that controls all displays attached to the NVIDIA DRIVE platform target. In configurations that include NVIDIA® Foundation, one Virtual Machine (VM) partition has sole control over the display.
The displayserver application provides access to display for other virtual machines. It runs on the VM that controls display, and accepts remote procedure call commands from graphics applications running on other VMs.
In the Linux-Linux hypervisor configuration, VM1 controls display and runs displayserver. VM2 requires a virtual ethernet connection to displayserver to use display.
To start displayserver on Linux VM1
1. Initialize the virtual Ethernet adapter (hv0), choosing an IP address, using the following command:
ifconfig hv0 <VM_address>/24 up
For example, using IP address 12.0.0.1
ifconfig hv0 12.0.0.1/24 up
2. Start the displayserver application using the following command
/usr/local/bin/displayserver &
To configure Linux VM2 for display
1. Set the DISPLAY_IP environment variable to the IP address of the virtual Ethernet adapter (hv0) of VM1 with the following command:
export DISPLAY_IP=<address of hv0 on VM1>
2. Initialize the virtual Ethernet adapter (hv0) to enable communication with displayserver (VM1, in this example) with the following command:
ifconfig hv0 <IP_address>/24 up
Where <IP_address> is an IP address on the same subnet as DISPLAY_IP. (For this example, 12.0.0.2 is an appropriate value.)
Configuring displayserver
To apply a configuration file to displayserver, specify the optional -c argument:
/usr/local/bin/displayserver [-c config.json] &
When -c is used, displayserver loads a configuration file in the JSON format. The configuration file, described below, allows for the remapping of display hardware. For example, the configuration file may specify that any client from VM1 that interacts with HEAD 0 will instead interact with physical Head 1.
Displayserver configuration file format
The configuration file is in JSON format per VM setting of permissions and resource mapping.
"vms": [{}, {}] /* an array of VM objects. */
For linux-linux, it has two VM objects.
Each VM object has 2 attributes:
{
"vm": "<VM_ID>",
"heads": [{}, {}, {}] /* an array of HEAD objects */
}
Each HEAD object represents the virtual head of this VM, which has 2 attributes:
{
/*
* The virtual head is used by the application in this VM.
* The physical head is the actual head of the display controller.
*/
"id": {"virt": "<virtual_head_id>", "phys": "<physical_head_id>"},
"wins": [{}, {}, {}] /* an array of WIN objects */
}
Each WINDOW object represents the virtual window of this HEAD, which only has 1 attribute:
{
/*
* For linux-linux-t186, display controller uses global window IDs.
* HEAD_0 has WIN_0, WIN_1 and WIN_2;
* HEAD_1 has WIN_3, WIN_4 and WIN_5.
* For integrity-linux-t186,
* HEAD_0 has WIN_0, WIN_1 and WIN_2;
* HEAD_1 has WIN_0, WIN_1 and WIN_2;
*/
"id": {"virt": "<virtual_window_id>", "phys": "<physical_window_id>"}
}
Example Configuration
The following is a sample configuration file that swaps Head 0 and Head 1 for VM1.
{
"vms": [{
"vm": "1",
"heads": [
{ "id": { "virt": "0", "phys": "1" },
"wins": [ { "id": { "virt": "0", "phys": "3" } },
{ "id": { "virt": "1", "phys": "4" } },
{ "id": { "virt": "2", "phys": "5" } }
]
},
{ "id": { "virt": "1", "phys": "0" },
"wins": [ { "id": { "virt": "3", "phys": "0" } },
{ "id": { "virt": "4", "phys": "1" } },
{ "id": { "virt": "5", "phys": "2" } }
]
}
]
}]
}
Usage Examples
To run Wayland applications on Linux VM2 using displayserver
Run applications (such as gears) from VM2, rendering to the display connected to VM1, with commands similar to the following:
mkdir -p /tmp/xdgruntime
export XDG_RUNTIME_DIR=/tmp/xdgruntime
chmod 700 /tmp/xdgruntime
DISPLAY_VM=0 DISPLAY_IP=12.0.0.1 weston --no-input --current-mode --overlay-compositing --connector=1000 &
cd drive-t186ref-linux/samples/opengles2/gears/wayland
./gears
In the above example, Weston runs on an attached DP display.
For more information on Weston and Wayland see Configuring the Weston Window Manager topic in Getting Started.
To run EGLOutput applications on Linux VM2 using displayserver
Export the VM1 IP address, then start the EGLOutput-based application for benchmarking, with commands similar to the following:
DISPLAY_VM=0 DISPLAY_IP=12.0.0.1 ./gears -1 &
To run Vulkan applications on Linux VM2 using display server
Follow the instructions for running the display server and for running Vulkan, then use commands similar to the following:
DISPLAY_VM=-1 DISPLAY_IP=12.0.0.1 ./vkcube