tenclass / mvisor-win-vgpu-driver

Implementation of OpenGL on windows guest virtual machine using Mesa/Virgl protocol.
GNU General Public License v3.0
111 stars 21 forks source link

compile under linux using mingw64 fails #7

Closed woecj closed 3 months ago

woecj commented 4 months ago

I tried to compile under debian bookworm using mingw. After cloning mesa and patching I tried the command from usermod/build.bat: meson setup build -Dbuildtype=release -Dgallium-drivers=virgl -Dgallium-windows-dll-name=MvisorVGPUx64 -Dllvm=disabled -Dprefix=/builddir This resulted in the following error: meson.build:251:2: ERROR: Problem encountered: swrast vulkan requires gallium swrast

Are there further preparations to compile under linux?

nooodles2023 commented 4 months ago

Maybe you could try to compile it on windows

woecj commented 4 months ago

Yes, I tried it just before. But also problems with missing things. I installed VS2019, python But now, pkg-config is missing - it seems that this program is thought for mingw environment. Would be useful to have a full description which package have to be available on windows to compile ...

nooodles2023 commented 4 months ago

Try to use vs2019 x64 native command window, cd to usermode directory and run build.bat. If it failed, post the error information here. The usermode driver is a patch for Mesa project, if you need more information about compilation, check this https://gitlab.freedesktop.org/mesa/mesa

woecj commented 4 months ago

Ok, the compile still does not work, at the end the message is 'flex lex not found' I enclose the compile log in the attaced file. meson-log.txt

Seems, installing VS2019 alone is not sufficient to compile ...

nooodles2023 commented 4 months ago

oh~how about just following the err message, flex is needed to be installed. I haven't gather the env information about compiling usermode driver yet. If you confused about it, maybe you could use the release building? If you want to get more info about it, try to compile the offical Mesa project, it will help you to establish the env of compilation!

woecj commented 4 months ago

Ok, I use the build package now (I did not recognise it exists before) Install in vm runs smooth I installed virgilrenderer in the host But when starting vm , I get an error [0.000] ../core/configuration.cc:257 LoadObjects() warn: object not found virtio-vgpu virtio-vgpu /dev/dri/renderD128 is existing Do I miss anything more?

nooodles2023 commented 4 months ago

have you put this in your config?

woecj commented 4 months ago

yes, I did

nooodles2023 commented 4 months ago

You need to add -Dvgpu=true when you compile mvisor

woecj commented 4 months ago

ok, after adding the option, the error messages vanishes. I had to load the virtio module on the host. Now windows10 starts with virtio-vgpu defined. How to check if opengl is working in the vm ? Geeks3D GPUTest crashes when starting test, also realtech opengl extensions viewer crashes ... I noted, that the install script does not copy opengl32.dll to the system32 directory. Should it?

nooodles2023 commented 4 months ago

if the opengl32.dll exists, you don't need to copy again. Check the device manager if the Mvisor VGPU in system device group worked.

woecj commented 4 months ago

Ok, Mvisor VGPU device in system device group is there and no errors in the device infos. I am unsure if the host system needs more preparation?

nooodles2023 commented 4 months ago

post some info from mvisor and guest vm when you run GPUtest.exe

woecj commented 4 months ago

There are no infos from mvisor or guest when running GPUtest.exe:

In Systeminfo, I found the following line: virtualrender VirtualRender c:\windows\system32\driverstore\filerepository\vrd.inf_amd64_81fbd405ff2470fc\vrd.sys Kerneldriver No Manuell Ended OK Ignore No No

nooodles2023 commented 4 months ago

What is virtualrender? why did you run GPUtest in cmd? Double click it and then post the screenshot here

woecj commented 4 months ago

I am sorry, I meant virglrenderer I started GPUtest also by doubleclicking. grafik When launching the test, an empty window appears and vanishes immediately

nooodles2023 commented 4 months ago

I am sorry, I meant virglrenderer I started GPUtest also by doubleclicking. grafik When launching the test, an empty window appears and vanishes immediately

select test with opengl4

nooodles2023 commented 4 months ago

There are no infos from mvisor or guest when running GPUtest.exe:

  • mvisor on host does not give any message while running GPUtest
  • in VM, also no message in cmdline window, just test window appears and vanishes w/o message Can I use options to increase the verbosity?

In Systeminfo, I found the following line: virtualrender VirtualRender c:\windows\system32\driverstore\filerepository\vrd.inf_amd64_81fbd405ff2470fc\vrd.sys Kerneldriver No Manuell Ended OK Ignore No No

the driver you showed was not the vgpu driver

woecj commented 4 months ago

That is what I see in the device manager: grafik

nooodles2023 commented 4 months ago

have you got any output about opengl in mvisor output? use dbgview to get more log in vm when you start GPUtest.exe !!!!

woecj commented 4 months ago

Nothing concerning graphics, only messages concerning sound not working: ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave [95966.913] ../gui/sdl/viewer.cc:232 OnPlayback() warn: snd_pcm_open error: No such file or directory Now, openglview from realtec does not crash, but on opengl - see screenshot here grafik

woecj commented 4 months ago

Here is the output of dbgview: grafik And here the output when running glview: grafik

Maybe my experience is connected to issue #2 ?

nooodles2023 commented 4 months ago

Here is the output of dbgview: grafik And here the output when running glview: grafik

Maybe my experience is connected to issue #2 ?

Yes~, the number 31 was the windows system error code which returned from getlasterror(). It failed to call DeviceIoControl to get caps from driver. Have you run GPUTest.exe as administrator? There were something wrong with the connection method between dll and driver.

woecj commented 4 months ago

yes, I tried to run GPUTest as administrator. The result is the same. Messages in Dbgview are absolute identical - See result screen shot above. How to solve the problem?

nooodles2023 commented 4 months ago

yes, I tried to run GPUTest as administrator. The result is the same. Messages in Dbgview are absolute identical - See result screen shot above. How to solve the problem?

It's a bug now, ctl_get_caps failed with error=31, something wrong in driver. Would you mind opening the dbgview with kernel output and post it here?

woecj commented 4 months ago

Ok, here is the output of dbgview with kernel output enabled: grafik Remark: GPUtest was started as normal user, did not start in administrator mode

nooodles2023 commented 4 months ago

image choose like this, and restart the dbgview

woecj commented 4 months ago

Here the output again, with kernel messages enabled (was also in the previos attempt) grafik GPUtest was started as normal user, did not start in administrator mode

nooodles2023 commented 4 months ago

Here the output again, with kernel messages enabled (was also in the previos attempt) grafik GPUtest was started as normal user, did not start in administrator mode

There isn't any info from kernel, try to stop catching user space, only catch kernel space

woecj commented 4 months ago

I disabled user space, only kernel space is enabled, then there is no capture output!

nooodles2023 commented 4 months ago

I disabled user space, only kernel space is enabled, then there is no capture output!

what is your guest os version, dbgview need be run as admin too

woecj commented 4 months ago

Guest is Windows10 Pro Version 10.0.19042 Build 19042

dbgview was run as Administrator

nooodles2023 commented 4 months ago

Guest is Windows10 Pro Version 10.0.19042 Build 19042

dbgview was run as Administrator

My guest env is 21H2(19044), it works well in the production env. I'd like to fix this bug but I can't find a way to reproduce the error=31

woecj commented 4 months ago

so, should I upgrade to 21h2 ?

nooodles2023 commented 4 months ago

so, should I upgrade to 21h2 ?

or you may need to wait for me to fix it, maybe next weekend

woecj commented 4 months ago

ok, would be nice if you can fix the bug. Thanks and I wish you success!

nooodles2023 commented 4 months ago

buddy, why do you want to test this vgpu? for interest?

woecj commented 4 months ago

I want to use some apps within the guest requesting opengl and available on windows only. Your mvisor implementation looks like very small and shows very good response behavior. So if your solution is stable and supplies opengl, I could possible switch from other solutions I use up to now (vmware is currently the only vm having really working opengl to my knowledge)

nooodles2023 commented 4 months ago

Can vmware support opengl4 in windows guest vm? I have tested opengl4 in virtualbox/vmware, but neither of them could work.

woecj commented 4 months ago

vmware has at least opengl 4.1 virtualbox has opengl 4.1 also , but buggy - some crucial functions do not work (experimental status)

Is the vgpu driver also useable in Qemu?

woecj commented 4 months ago

Tested it also using Windows10 21H2 19044: result is the same not working, same behavior! Host: Linux debian bookworm on AMD Ryzen 7 5800X 8-core, KDE Plasma version 5.27.5 Nvidia graphics GeForce RTX 3060, Nvidia driver, version 525.147.05

nooodles2023 commented 4 months ago

Tested it also using Windows10 21H2 19044: result is the same not working, same behavior! Host: Linux debian bookworm on AMD Ryzen 7 5800X 8-core, KDE Plasma version 5.27.5 Nvidia graphics GeForce RTX 3060, Nvidia driver, version 525.147.05

would you mind publish your qcow2 file on the cloud where I can download to test?

nooodles2023 commented 4 months ago

vmware has at least opengl 4.1 virtualbox has opengl 4.1 also , but buggy - some crucial functions do not work (experimental status)

Is the vgpu driver also useable in Qemu?

no, it's not for qemu. GPUtest.exe can be run with open4.1 test on win10 guest vm using vmware?

woecj commented 4 months ago
  1. publishing qcow2: im I am not shure if it is it worth to transfer such big file (~ 17GB)?
  2. yes GPUtest is working in vmware with 4.1 tests!
nooodles2023 commented 4 months ago
  1. publishing qcow2: im I am not shure if it is it worth to transfer such big file (~ 17GB)?
  2. yes GPUtest is working in vmware with 4.1 tests!

what's the version of vmware? Would mind post the screenshot when Gputest working on vmware?

woecj commented 4 months ago

vmware workstation 16 grafik

nooodles2023 commented 4 months ago

vmware workstation 16 grafik

thank you~ Does virtual box support it?

woecj commented 4 months ago

Yes, virtualbox also support it - see enclosed sceenshot: grafik