From 18b99f9275cdb2473f52706c0d4d33636e8055c5 Mon Sep 17 00:00:00 2001 From: Fumiya Kohzu Date: Thu, 22 Jun 2023 20:17:58 +0900 Subject: Unified HMI: initial commit This is the initial commit for RVGPU of Unified HMI. `Unified HMI` is a common platform that promotes UX innovation in integrated cockpits and enables flexible information display from various applications across multiple displays. `RVGPU` is a client-server based rendering engine that creates 3D commands on a client device, sends them to a server for GPU rendering, and displays the results. - create new layer, meta-uhmi - create sub-layer, meta-rvgpu - add 1 feature to enable basesystem, agl-rvgpu Bug-AGL: SPEC-4744 Change-Id: I9b6f3966e3d5a859787f81c41b584fa686fd1f87 Signed-off-by: Fumiya Kohzu --- meta-uhmi/meta-rvgpu/README.md | 131 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 meta-uhmi/meta-rvgpu/README.md (limited to 'meta-uhmi/meta-rvgpu/README.md') diff --git a/meta-uhmi/meta-rvgpu/README.md b/meta-uhmi/meta-rvgpu/README.md new file mode 100644 index 00000000..64ed4c00 --- /dev/null +++ b/meta-uhmi/meta-rvgpu/README.md @@ -0,0 +1,131 @@ +## Remote Virtio GPU Device support layer(meta-rvgpu) +The RVGPU rendering engine, operating on a client-server model, creates 3D rendering commands on a client device and transmits them to a server device via the network, where the server-side device performs GPU-based rendering and displays the results. The meta-rvgpu currently supports x86, Raspberry Pi 4, and Renesas Boards platforms. +RVGPU is OSS. For more details, visit the following URL: +https://github.com/unified-hmi/remote-virtio-gpu + +## How to build +Follow the [AGL documentation](https://docs.automotivelinux.org/en/master/#01_Getting_Started/02_Building_AGL_Image/01_Build_Process_Overview/) for the build process, and set up the "[Initializing Your Build Environment](https://docs.automotivelinux.org/en/master/#01_Getting_Started/02_Building_AGL_Image/04_Initializing_Your_Build_Environment/)" section as described below to enable the AGL feature 'agl-rvgpu'. For example: +``` +$ cd $AGL_TOP/master +$ source ./meta-agl/scripts/aglsetup.sh -m qemux86-64 -b qemux86-64 agl-demo agl-devel agl-rvgpu +``` +After adding the feature, execute the command: +``` +$ bitbake +``` +Replace the `` with the appropriate values you want. We have confirmed the operation with the **agl-demo-platform**. + +## How to setup and boot +For Environment setup instructions for each platform, refer to the following link in the AGL Documentation. +[Building for x86(Emulation and Hardware)](https://docs.automotivelinux.org/en/master/#01_Getting_Started/02_Building_AGL_Image/07_Building_for_x86_%28Emulation_and_Hardware%29/) +[Building for Raspberry Pi 4](https://docs.automotivelinux.org/en/master/#01_Getting_Started/02_Building_AGL_Image/08_Building_for_Raspberry_Pi_4/) +[Building for Supported Renesas Boards](https://docs.automotivelinux.org/en/master/#01_Getting_Started/02_Building_AGL_Image/09_Building_for_Supported_Renesas_Boards/) + +For Raspberry Pi 4 and Supported Renesas Boards, refer to the above URL for boot methods. +For x86 emulation (qemu), network bridge is required to enable communication with other devices when using RVGPU. Here’s an example procedure for your reference. +``` +$ sudo ip link add type bridge +$ sudo ip addr add dev +$ sudo ip link set dev master +$ sudo ip link set dev up +``` +Replace the placeholders with the appropriate values: +- ``: You can assign any name, for example: `br0` +- ``: Enter an available IP address, for example: `192.168.0.100/24` +- ``: Specify the network interface, for example: `eth0` + +To enable the use of the bridge, create or append /etc/qemu directory and /etc/qemu/bridge.conf file. +``` +allow +``` +Make sure /etc/qemu/ has 755 permissions. +Create the following bash file named **run_qemu_bridge.sh** in any ``. +``` +#!/bin/bash + +KERNEL_PATH=$1 +DRIVE_PATH=$2 +BRIDGE_NAME="" + +printf -v macaddr "52:54:%02x:%02x:%02x:%02x" $(( $RANDOM & 0xff)) $(( $RANDOM & 0xff )) $(( $RANDOM & 0xff)) $(( $RANDOM & 0xff )) + +qemu-system-x86_64 -enable-kvm -m 2048 \ + -kernel ${KERNEL_PATH} \ + -drive file=${DRIVE_PATH},if=virtio,format=raw \ + -cpu kvm64 -cpu qemu64,+ssse3,+sse4.1,+sse4.2,+popcnt \ + -vga virtio -show-cursor \ + -device virtio-net-pci,netdev=net0,mac=$macaddr \ + -netdev bridge,br=$BRIDGE_NAME,id=net0 \ + -serial mon:stdio -serial null \ + -soundhw hda \ + -append 'root=/dev/vda rw console=ttyS0,115200n8 fstab=no' +``` +Save the file and run the following to start QEMU. +``` +sudo /run_qemu_bridge.sh /tmp/deploy/images/qemux86-64/bzImage /tmp/deploy/images/qemux86-64/agl-demo-platform-qemux86-64.ext4 +``` +When QEMU boot, assign an IP address. For example: +``` +ifconfig 192.168.0.10 netmask 255.255.255.0 +``` + +## How to run RVGPU remotely +Prepare two images, one as the Sender and the other as the Receiver. +It is necessary for the Sender and Receiver to be within the same network. + +**Receiver side** +``` +$ export XDG_RUNTIME_DIR=/run/user/ +$ rvgpu-renderer -b 1080x1500@0,0 -p & +``` +Replace the placeholders with the appropriate values: +- ``: Specify according to your environment, for example:1001 +- ``: Enter an available port number, for example: 55555 + +**Sender side** +Create the following shell script **run_remote_app.sh** in any `` for a smooth experience. +``` +#!/bin/bash + +mkdir -p /run/user/ +export XDG_RUNTIME_DIR=/run/user/ +export LD_LIBRARY_PATH=/usr/lib/mesa-virtio + +# ------------- +# launch app +# ------------- +$@ +``` +Replace the placeholders with the appropriate values: +- ``: You can assign any UID, for example: 0 + +Save the file and run the following to start weston. + +``` +$ rvgpu-proxy -s 1080x1500@0,0 -n : & +$ /run_remote_app.sh weston --backend drm-backend.so -Swayland-0 --seat=seat_virtual -i 0 & +``` +Replace the placeholders with the appropriate values: +- ``: Port set in the renderer. + +After completing these steps, the Weston screen from the Sender will be transferred and displayed on the Receiver using rvgpu-proxy and rvgpu-renderer. You can verify that everything is functioning properly by launching wayland applications on the Sender side, such as: +``` +$ /run_remote_app.sh weston-simple-egl -f +``` + +You can also verify the touch or keyboard operation support of the RVGPU by using app such as +``` +$ /run_remote_app.sh weston-smoke +$ /run_remote_app.sh weston-editor +``` +**Note**: There are known issues with mouse, such as the cursor becoming invisible and occasional flickering of a green screen. + +**Appendix**: +- You can freely change the display position of the transferred surface in rvgpu-renderer by w option, such as + ``` + rvgpu-renderer -b 1080x1500@0,0 -p -w , + ``` + The coordinates `, = 0,0` represent the top-left corner, and the default position is `0,250`. + +- By building the RVGPU on Ubuntu, it is possible to enable bidirectional remote rendering between the agl-demo-platform and Ubuntu. + For the build procedure on Ubuntu, see the following URL: https://github.com/unified-hmi/remote-virtio-gpu -- cgit 1.2.3-korg