Announcement

Collapse
No announcement yet.

VirtualBox 4.1 OpenGL 3D Guest Performance

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • VirtualBox 4.1 OpenGL 3D Guest Performance

    Phoronix: VirtualBox 4.1 OpenGL 3D Guest Performance

    While KVM may be very fast for Linux virtualization, one of the areas where VMware and VirtualBox are superior is when it comes to the ability to provide hardware-accelerated 2D/3D support to guest virtual machines that ultimately is passed onto the host and its graphics card / driver. In this benchmark is a look at the gaming performance of Oracle's VM VirtualBox 4.1 when using their "Chromium" driver to enable guest Linux OpenGL acceleration.

    http://www.phoronix.com/vr.php?view=16674

  • #2
    Looks like some kind of vsync deal is going on.

    Comment


    • #3
      Originally posted by Derpinator View Post
      Looks like some kind of vsync deal is going on.
      Not sure, because not all the framerates are equal. This is linux host, linux guest right? Maybe some combinations do better than others?

      Comment


      • #4
        These charts imply that the bottleneck is in the communication tunnel between the guest and the host. The communication overhead is large enough that it trumps any impact increased resolution may have.

        For instance, LiveArena ranges between 2.2 ms/frame and 11.5 ms/frame on bare metal, and between 46.7 ms/frame and 48.5 ms/frame through the tunnel. This implies some 40+-5 ms of overhead when run through the tunnel - or some other bug in VirtualBox (4.1.2 a few months out of date, the latest version is 4.1.6).

        Edit: Ah Linux guest? That's quite a bit slower than a Windows guest, because Linux guests don't get 2d acceleration and don't play well with OpenGL compositors (there are two different OpenGL compositors running, one in the guest and one on the host, which does lead to sync issues). This is what happens with two compositors: 3d in guest -> send 3d commands to host -> 3d compositor in guest -> send 3d commands to host -> 3d compositor in host -> display on screen. Disable the guest compositor and you get other problems: 3d in guest -> send 3d commands to host -> read result from host (non-accelerated!) -> display in guest -> 3d compositor in host -> display on screen.

        It's going to be slow no matter what you do. For best results, you'd need to disable the host and guest compositors and implement 2d acceleration in the guest.
        Last edited by BlackStar; 11-08-2011, 08:10 AM.

        Comment


        • #5
          I once tried some of the Introversion games in a Windows 7 VBox and they actual run with the Direct3D driver, but not at a playable speed. What works is watching fullscreen flash videos on the guest...

          Comment


          • #6
            I feel that the virtual GPU needs to be overall ignored and GPU passthrough should be focused on. However, I don't think the virtual GPU should be removed. As I see it, the only easy way for GPU passthrough to work is to have a separate monitor and a GPU that is not in use by the host OS. I think if Oracle can accomplish that then that's a huge achievement. As for needing a separate monitor, an easy hack to avoid that would be to use a VNC.

            Comment


            • #7
              Maybe I'm saying something stupid but :

              As the framerate seems not to change when the resolution grows, isn't it that the bottleneck would be the processor, instead of the graphics card ?

              Comment


              • #8
                Originally posted by schmidtbag View Post
                I feel that the virtual GPU needs to be overall ignored and GPU passthrough should be focused on. However, I don't think the virtual GPU should be removed. As I see it, the only easy way for GPU passthrough to work is to have a separate monitor and a GPU that is not in use by the host OS. I think if Oracle can accomplish that then that's a huge achievement. As for needing a separate monitor, an easy hack to avoid that would be to use a VNC.
                While I think that this is something that should get done eventually, there's no way that I'm going to install a second video card in my machine just to run a virtual machine at a faster 3D speed. I'd much prefer to be able to use the full capabilities of the host GPU than rely on a crutch like installing a second heat-producing GPU just to increase VM performance.

                Comment


                • #9
                  Originally posted by Veerappan View Post
                  While I think that this is something that should get done eventually, there's no way that I'm going to install a second video card in my machine just to run a virtual machine at a faster 3D speed. I'd much prefer to be able to use the full capabilities of the host GPU than rely on a crutch like installing a second heat-producing GPU just to increase VM performance.
                  like I said, I don't think the virtual GPU should be removed, just not so heavily focused on. The reason I said that is specifically for reasons like what you mentioned. Keep in mind though that many processors that support passthrough already have an integrated GPU, so either that or the discrete card could be used for a VM. But for those who don't have passthrough support or don't have at least 2 GPUs, the virtual GPU is an acceptable alternative.

                  Comment


                  • #10
                    i just did a quick test
                    system: phenom 955 and a rusty old geforce 7800gtx, nvidia 290.06 driver
                    1: debian sid amd64 host system with xfce and mutter compositor, ondemand cpu governor, 25% up_threshold
                    2: ubuntu 11.10 amd64 guest with unity, ondemand cpu governor, default up_threshold
                    3: ubuntu 11.10 amd64 guest with unity, ondemand cpu governor, 25% up_threshold
                    1:
                    2:
                    3:

                    so, the ondemand cpu governor might be a reason for bad performance, too

                    Comment


                    • #11
                      Originally posted by BlackStar View Post
                      These charts imply that the bottleneck is in the communication tunnel between the guest and the host. The communication overhead is large enough that it trumps any impact increased resolution may have.

                      For instance, LiveArena ranges between 2.2 ms/frame and 11.5 ms/frame on bare metal, and between 46.7 ms/frame and 48.5 ms/frame through the tunnel. This implies some 40+-5 ms of overhead when run through the tunnel - or some other bug in VirtualBox (4.1.2 a few months out of date, the latest version is 4.1.6).

                      Edit: Ah Linux guest? That's quite a bit slower than a Windows guest, because Linux guests don't get 2d acceleration and don't play well with OpenGL compositors (there are two different OpenGL compositors running, one in the guest and one on the host, which does lead to sync issues). This is what happens with two compositors: 3d in guest -> send 3d commands to host -> 3d compositor in guest -> send 3d commands to host -> 3d compositor in host -> display on screen. Disable the guest compositor and you get other problems: 3d in guest -> send 3d commands to host -> read result from host (non-accelerated!) -> display in guest -> 3d compositor in host -> display on screen.

                      It's going to be slow no matter what you do. For best results, you'd need to disable the host and guest compositors and implement 2d acceleration in the guest.
                      Wouldn't it be a more intriguing test to try PCI Express x16 VGA Passthrough? If using Intel sandy bridge architecture, to try vt-d compatible hardware w/ vt-d turned on in the bios and then test the open source games in virtualbox?

                      That is, if vt-d works in Vbox yet. But, I thought maybe the only way right now to get any sort of performance improvement.

                      I'm just asking...

                      Seems to me a lot has to happen for Vbox to take 'generic video card' and produce much in terms of performance when playing games......

                      Comment


                      • #12
                        Originally posted by Panix View Post
                        Wouldn't it be a more intriguing test to try PCI Express x16 VGA Passthrough? If using Intel sandy bridge architecture, to try vt-d compatible hardware w/ vt-d turned on in the bios and then test the open source games in virtualbox?

                        That is, if vt-d works in Vbox yet. But, I thought maybe the only way right now to get any sort of performance improvement.

                        I'm just asking...

                        Seems to me a lot has to happen for Vbox to take 'generic video card' and produce much in terms of performance when playing games......
                        I have already tried vga passthrough using an unused, discrete video card on an AMD IOMMU system. the gpu is recognized and can be installed but it can't be activated. i have tried everything i can think of and it still doesn't work. vga/gpu passthrough is not at all similar to regular pci, so there's more changes to be done.

                        Comment


                        • #13
                          Originally posted by schmidtbag View Post
                          I have already tried vga passthrough using an unused, discrete video card on an AMD IOMMU system. the gpu is recognized and can be installed but it can't be activated. i have tried everything i can think of and it still doesn't work. vga/gpu passthrough is not at all similar to regular pci, so there's more changes to be done.
                          Intriguing! I thought VirtualBox didn't support IOMMU but apparently I was wrong. Do you know which CPUs offer this capability (any chance for a Phenom 2 965BE?)

                          Comment


                          • #14
                            The CPU is not that important in case of AMD, but the chipset. Every series 9 chipset and 890FX can be used for that.

                            Comment


                            • #15
                              As far as I remember, Xen is the only VGA pass-through capable VM platform. (As far as I can see VBox is PCI-E pass-though capable, but not VGA pass-through.)

                              - Gilboa
                              DEV: Intel S2600C0, 2xE52658V2, 32GB, 4x2TB + 2x3TB, GTX780, F21/x86_64, Dell U2711.
                              SRV: Intel S5520SC, 2xX5680, 36GB, 4x2TB, GTX550, F21/x86_64, Dell U2412..
                              BACK: Tyan Tempest i5400XT, 2xE5335, 8GB, 3x1.5TB, 9800GTX, F21/x86-64.
                              LAP: ASUS N56VJ, i7-3630QM, 16GB, 1TB, 635M, F21/x86_64.

                              Comment

                              Working...
                              X