Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual Machine #34

Closed
GFOXSH opened this issue Oct 22, 2016 · 3 comments
Closed

Virtual Machine #34

GFOXSH opened this issue Oct 22, 2016 · 3 comments

Comments

@GFOXSH
Copy link

GFOXSH commented Oct 22, 2016

Can I add OpenGL support in a virtual machine Debian, using VirtualGL?

@dcommander
Copy link
Member

The answer depends on which virtual machine software is being used. VirtualBox and VMWare both have a set of extensions (the VirtualBox Guest Additions and the VMWare Tools, respectively) that run inside of the virtual machine and redirect OpenGL calls to the host. You can use those extensions with VirtualGL in a couple of ways:

  1. Run the entire VM as a process within VirtualGL, which allows you to run the VM inside of a TurboVNC session (or another X proxy session) with hardware OpenGL acceleration. This is fully documented in the User's Guide and supported, and with respect to VirtualBox, this is how we support remotely displaying Windows 3D applications with VirtualGL (it doesn't really matter which operating system you are running as a guest, as long as the virtual machine tools support OpenGL redirection from that operating system to the host.)
  2. Run an X proxy along with VirtualGL inside the VM itself. This may work in some cases, but not in all cases. The VirtualBox Guest Additions, for instance, don't always seem to support Pbuffers and other OpenGL features that VirtualGL needs. This approach tends to work much better with Parallels Desktop than it does with VirtualBox, and in fact I use Parallels Desktop to test a lot of different Linux distributions with VirtualGL (but of course Parallels is a Mac-only product.) This approach is primarily useful for testing, because the VM itself has to be running on a physical display with 3D hardware acceleration.

In both cases, VirtualGL isn't "adding" OpenGL to the VM environment per se. The OpenGL support is added by the guest additions/tools, and VirtualGL uses that environment to provide remote display capabilities.

Another user is looking at ways to run VirtualGL in a docker container (refer to #30), so if you are interested in that approach, you might want to contact that user and see how this can be accomplished.

If you can provide more information about what you are trying to accomplish, then I may be able to provide a more thorough answer.

@GFOXSH
Copy link
Author

GFOXSH commented Oct 23, 2016

I would like to redirect the OpenGL calls from ExaGear to VirtualGL, instead standard use glshim_remote, as described here: pelya/xserver-xsdl#45

@dcommander
Copy link
Member

VirtualGL is designed for redirecting OpenGL/GLX calls within the same machine, and it currently requires two X servers:

  • The "3D X server" interfaces with the GPU and receives the GLX calls that VirtualGL redirects from the application. All of the GLX context creation calls (glXCreate[New]Context(), etc.) are modified by VirtualGL to redirect those calls to the 3D X server and to redirect the OpenGL rendering into Pbuffers instead of X windows. This sets up the OpenGL state so that any subsequent OpenGL calls will be passed through to the 3D X server without modification. This effectively "splits" the 3D and 2D rendering, allowing the 3D rendering to occur on a GPU, and allowing the 2D rendering to occur within an X proxy that has no connection to physical graphics hardware.

    Access the GPU without going through an X server #10 will allow VirtualGL to redirect OpenGL through a device-level EGL interface, which should eliminate the need for the 3D X server.

  • The "2D X server" renders all of the non-OpenGL X11 calls. It also receives the rendered 3D pixels that VirtualGL reads back from the GPU and displays using regular X11 calls.

I still don't fully understand what you're trying to do (isn't xserver-xdl only for Android?) But it does seem as if VirtualGL isn't going to do what you need-- at least not yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants