Last month, I saw a post by mr.chrismitchells, it is a project working with the GPU virtualization, then I got inspired to work on this demo too. Compared with the post, I have a jetson TX2 board, so why not have a try?
The first weeks I tried to enable KVM followed with this guide, at first glance, I found a lot of problems especially the qemu kvm is not worked, which tells me the USR_IRQ xxx problem when add -enable-kvm in qemu run script.
After a lot of tests on qemu scripts, I still not get it worked. Once I just try to give up. Then I thought maybe KVM was not correctly enabled, by comparing the dmesg log of init of KVM, I found it bypassed the vgic_init with error no ENODEV. OK, I think that is the root cause. I didnt correct update the DTB file, although I thought I have replaced in boot/dtb folder, but this is not work for the current L4T version.
Then I tried again, the VM runs like a butter, and tried the virtio-gpu based GPU virtualization in VM, it also works well, see following figure:
Here’s a screenshot of Ubuntu20.04 running with virgl-backed virtio-gpu, meanwhile host is running a vulkan sample with 60fps:
Have fun and Enjoy your hack!