Keenuts / virtio-gpu-win-icd

OpenGL ICD for Virtio-GPU Windows driver
BSD 2-Clause "Simplified" License
85 stars 14 forks source link

opengl_context.exe can not work normal #4

Closed BruceMok closed 3 years ago

BruceMok commented 3 years ago

hi, I compile this source in VS2019 successfully (not in guest). Then i copy them to guest and run opengl_context.exe. But it do not display anything and exit quickly. Qemu configure this Windows guest use qxl vidoe model, should i change to use virtio-gpu video model? or any other mistake i have made.

thanks.

BruceMok commented 3 years ago

I install the virtio-gpu-dod driver, it can not work too (error code 31).

Keenuts commented 3 years ago

Hi!

Yes, you need to run the guest with virtio-gpu video model, not QXL. Also, this ICD requires kernel support on Windows. Explanation: https://www.studiopixl.com/2017-08-27/3d-acceleration-using-virtio.html

One note: even if everything compiles, and you use the provided patched kernel driver, things might not work anymore. The graphic driver on windows was written without any support/documentation from Microsoft. When writing this code, I had to fumble around to understand how windows behaved. And because of time constraints, I decided to bypass everything using the escape function: https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/d3dkmddi/nc-d3dkmddi-dxgkddi_escape

If you want to work on this project, the best way to start is:

  1. Build the ICD and the example opengl app
  2. Check that the ICD is correctly used by the sample opengl app.
  3. Build and install the modified virtio-gpu-dod driver: https://github.com/Keenuts/virtio-gpu-win
  4. Using a kernel debugger, make sure the escape function receives some payload from the custom ICD
  5. Using debugger/print on the host, make sure Virglrenderer receives the commands from the guest

Once you get some commands coming from the guest to the host, you are good to go! Next step is to build a proper ICD, and integrate correctly with the D3DKMD interface :)

stuaxo commented 3 years ago

@Keenuts this is really good info that could do with being up front in the README.md

BruceMok commented 3 years ago

@Keenuts Thanks very much, your reply is detailed and helpful.

Keenuts commented 3 years ago

Thanks all, expanded the Readme as suggested.

stuaxo commented 3 years ago

Nice work :)

The expanded README is really, good - giving enough info for someone to pick this up - it covers loads of the details that could stop someone in their tracks.