Closed ZLangJIT closed 3 weeks ago
I think it would be better to invest into a virtio-gpu
device implementation and reuse existing virglrenderer
on host and Mesa virgl
driver in guest.
I think it would be better to invest into a
virtio-gpu
device implementation and reuse existingvirglrenderer
on host and Mesavirgl
driver in guest.
would that work on windows OS host as well as unix* hosts ?
hmm https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24223
ok i managed to get https://gitlab.freedesktop.org/virgl/virglrenderer compiling for the ndk (api 28) in cmake with meson
https://github.com/ZLangJIT/riscv-kernel/actions/runs/11163610342/job/31030971191
virgl
module compiledpatch-cache based build system
to automate component builds (mainly the buildroot and kernel)cache-patch
, this is intended to support only single version caching via the latest version - a new version overwrites
the old versionpatches-<component>
where <component>
is the component name, eg kernel.patch
should be in a release with the patches-kernel
release tag and MUST contain the following files - kernel.patch
, kernel.patch.latest.major
, kernel.patch.latest.minor
, kernel.patch.latest.version_code
and MAY contain any other files as needed(optional) edit stuff in the source tree and generate a new patch
push a patch (can be same patch as previously pushed) for a source tree and the patch-cache handles the rest (provided it is correctly set up)major
version in the case where any signifigant changes should occur in their view (optional)major 1 , minor 0 , version code 1
a
code 1 and b
code 2 yields global code 3 , where a
and b
are seperate components).patch
file in the corresponding component cachemake CC=gcc
to make CC=clang
unless this change occurs inside the file tree itself (such as inside a build script located in the source tree)specifically, to clarify the above
virglrenderer
compiled for ndk aarch64 in the android host apkvirtio virgl
kernel module compiled ([*]
) in the rvvm guest kernelmesa
, x11
, opengl
and egl
(and a few test applications) compiled into the guest kernel cpio via buildrootbut i do not know how to make virglrenderer
and virgl
talk to eachother
apparently the vm must support a virtio gpu
hmm
https://gitlab.com/qemu-project/qemu/-/blob/master/include/hw/virtio/virtio-gpu.h
https://gitlab.com/qemu-project/qemu/-/blob/master/hw/display/virtio-gpu-gl.c
https://developer.ibm.com/articles/l-virtio/ - Virtio Architecture
hmm https://www.intel.com/content/www/us/en/docs/programmable/683140/24-2-12-1-0/virtio.html
@LekKit how might i go about beginning to port this from qemu over to rvvm ?
https://gitlab.com/qemu-project/qemu/-/tree/master/hw/virtio oof, lots of files
hmm https://docs.oasis-open.org/virtio/virtio/v1.2/virtio-v1.2.html appears to be the reference for the HOST implementation of virtio (vm/hyperv/kvm/ect side) and for the CLIENT implementation of virtio (guest/kernel side)
the only implementation of virt-gpu i can find is qemu's hw/display/virtio*.c
not even the kernel has a virt-gpu implementation, just seems to have a guest implementation even though the kernel has a KVM hypervisor implementation
hmm https://github.com/sysprog21/semu/pull/34 - implement virtio-gpu + utilize kernel virgl + host virglrenderer
I hope they won't be mad if we look at their implementation and reuse it somewhat :)
@X547 Could you please look at this whenever you have free time? It seems that GUI backends don't need any changes for this.
imma move to a new issue
Nah it's fine here
how might i go about implementing GPU acceleration support via rvvm and a custom riscv kernel, specifically
GL INSTANCE - RENDERER - PID 284 - HOST SHELL - RVVM - KERNEL - PID 382 = GUEST
as im thinking of something like https://github.com/dmaivel/sharedgl for api remoting from the guest to the host (android EGL host context) tho im not sure how to go about such
most implementations (using qemu) seem to expose shared memory (eg
/dev/shm/foo
or/dev/ashmem/foo
(not sure what win32 equivilant would be) ) from host to guest which can be used for the custom guest driver to communicate with the host remoting server among other purposes