1 ## Remote Virtio GPU Device support layer(meta-rvgpu)
2 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.
3 RVGPU is OSS. For more details, visit the following URL:
4 https://github.com/unified-hmi/remote-virtio-gpu
7 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:
10 $ source ./meta-agl/scripts/aglsetup.sh -m qemux86-64 -b qemux86-64 agl-demo agl-devel agl-rvgpu
12 After adding the feature, execute the command:
14 $ bitbake <image_name>
16 Replace the `<image_name>` with the appropriate values you want. We have confirmed the operation with the **agl-demo-platform**.
18 ## How to setup and boot
19 For Environment setup instructions for each platform, refer to the following link in the AGL Documentation.
20 [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/)
21 [Building for Raspberry Pi 4](https://docs.automotivelinux.org/en/master/#01_Getting_Started/02_Building_AGL_Image/08_Building_for_Raspberry_Pi_4/)
22 [Building for Supported Renesas Boards](https://docs.automotivelinux.org/en/master/#01_Getting_Started/02_Building_AGL_Image/09_Building_for_Supported_Renesas_Boards/)
24 For Raspberry Pi 4 and Supported Renesas Boards, refer to the above URL for boot methods.
25 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.
27 $ sudo ip link add <bridge_name> type bridge
28 $ sudo ip addr add <IP address> dev <bridge_name>
29 $ sudo ip link set dev <interface> master <bridge_name>
30 $ sudo ip link set dev <bridge_name> up
32 Replace the placeholders with the appropriate values:
33 - `<bridge_name>`: You can assign any name, for example: `br0`
34 - `<IP_address>`: Enter an available IP address, for example: `192.168.0.100/24`
35 - `<interface>`: Specify the network interface, for example: `eth0`
37 To enable the use of the bridge, create or append /etc/qemu directory and /etc/qemu/bridge.conf file.
41 Make sure /etc/qemu/ has 755 permissions.
42 Create the following bash file named **run_qemu_bridge.sh** in any `<WORKDIR>`.
48 BRIDGE_NAME="<bridge_name>"
50 printf -v macaddr "52:54:%02x:%02x:%02x:%02x" $(( $RANDOM & 0xff)) $(( $RANDOM & 0xff )) $(( $RANDOM & 0xff)) $(( $RANDOM & 0xff ))
52 qemu-system-x86_64 -enable-kvm -m 2048 \
53 -kernel ${KERNEL_PATH} \
54 -drive file=${DRIVE_PATH},if=virtio,format=raw \
55 -cpu kvm64 -cpu qemu64,+ssse3,+sse4.1,+sse4.2,+popcnt \
56 -vga virtio -show-cursor \
57 -device virtio-net-pci,netdev=net0,mac=$macaddr \
58 -netdev bridge,br=$BRIDGE_NAME,id=net0 \
59 -serial mon:stdio -serial null \
61 -append 'root=/dev/vda rw console=ttyS0,115200n8 fstab=no'
63 Save the file and run the following to start QEMU.
65 sudo <WORKDIR>/run_qemu_bridge.sh <build_directory>/tmp/deploy/images/qemux86-64/bzImage <build_directory>/tmp/deploy/images/qemux86-64/agl-demo-platform-qemux86-64.ext4
67 When QEMU boot, assign an IP address. For example:
69 ifconfig <your environment> 192.168.0.10 netmask 255.255.255.0
72 ## How to run RVGPU remotely
73 Prepare two images, one as the Sender and the other as the Receiver.
74 It is necessary for the Sender and Receiver to be within the same network.
78 $ export XDG_RUNTIME_DIR=/run/user/<your_UID>
79 $ rvgpu-renderer -b 1080x1500@0,0 -p <Port_Number> &
81 Replace the placeholders with the appropriate values:
82 - `<your_UID>`: Specify according to your environment, for example:1001
83 - `<Port_Number>`: Enter an available port number, for example: 55555
86 Create the following shell script **run_remote_app.sh** in any `<WORKDIR>` for a smooth experience.
90 mkdir -p /run/user/<New_UID>
91 export XDG_RUNTIME_DIR=/run/user/<New_UID>
92 export LD_LIBRARY_PATH=/usr/lib/mesa-virtio
99 Replace the placeholders with the appropriate values:
100 - `<New_UID>`: You can assign any UID, for example: 0
102 Save the file and run the following to start weston.
105 $ rvgpu-proxy -s 1080x1500@0,0 -n <IP_address_of_Receiver>:<Port_Number> &
106 $ <WORKDIR>/run_remote_app.sh weston --backend drm-backend.so -Swayland-0 --seat=seat_virtual -i 0 &
108 Replace the placeholders with the appropriate values:
109 - `<Port_Number>`: Port set in the renderer.
111 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:
113 $ <WORKDIR>/run_remote_app.sh weston-simple-egl -f
116 You can also verify the touch or keyboard operation support of the RVGPU by using app such as
118 $ <WORKDIR>/run_remote_app.sh weston-smoke
119 $ <WORKDIR>/run_remote_app.sh weston-editor
121 **Note**: There are known issues with mouse, such as the cursor becoming invisible and occasional flickering of a green screen.
124 - You can freely change the display position of the transferred surface in rvgpu-renderer by w option, such as
126 rvgpu-renderer -b 1080x1500@0,0 -p <Port_Number> -w <x>,<y>
128 The coordinates `<x>,<y> = 0,0` represent the top-left corner, and the default position is `0,250`.
130 - By building the RVGPU on Ubuntu, it is possible to enable bidirectional remote rendering between the agl-demo-platform and Ubuntu.
131 For the build procedure on Ubuntu, see the following URL: https://github.com/unified-hmi/remote-virtio-gpu