1 2 Previous Next 21 Replies Latest reply on Mar 12, 2012 1:29 AM by ruymbeke

    [Linux guests] vmwgfx Testing

    allquixotic Enthusiast


      vmwgfx is the name of the next generation 2d and 3d acceleration architecture for Linux guests running under VMware. vmwgfx consists of a kernel module (currently in the mainline Linux kernel in the staging area); libdrm (the userland direct rendering manager interface) changes; and userspace components of the Gallium3D architecture providing GLX, X11, and OpenGL support, as well as 2D acceleration.



      As far as I can tell, the actual components of Gallium3D that vmwgfx consists of are: `vmware' winsys, and `svga' driver. It would appear that EGL provides GLX (and OpenGL 2.1), but a lot of the state tracker stuff is not specifically tied to vmwgfx.



      vmwgfx is still in development,  but it is possible to test it today, and get some interesting results. By "interesting" I mean, not fully functional, but definitely showing signs of progress.



      I am making this post to get the community interested in / excited about vmwgfx, and to install it and test it with various hardware and Linux distributions. The more mindshare this has, the more likely that it will be included in the likes of Fedora 14 and Ubuntu 10.10. Unless it is included by default in the distributions, the install for users will be too arduous for most to attempt.



      I am not going to provide a step by step for installing it, because it depends on your distro; but I will give high level instructions for people who know how to roll their own graphics stack:



      1. Compile a 2.6.34 or 2.6.35 kernel with CONFIG_DRM_VMWGFX=m



      2. Compile libdrm from git://anongit.freedesktop.org/mesa/drm either the 2.4.20 release or anything later (although master may be broken, so try a release first)



      3.  Compile mesa from git://anongit.freedesktop.org/mesa/mesa with --enable-gallium-svga passed to configure. I couldn't get it to work with master as of this writing, so once you clone the repo, switch to the 7.8 branch: git checkout 7.8



      4. Modify your xorg.conf to look something like this:



      Section "ServerLayout"

          Identifier     "X.org Configured"

          Screen      0  "Screen0" 0 0

          InputDevice    "Mouse0" "CorePointer"

          InputDevice    "Keyboard0" "CoreKeyboard"



      Section "Files"

          ModulePath   "/usr/lib/xorg/modules"

          FontPath     "/usr/share/fonts/X11/misc"

          FontPath     "/usr/share/fonts/X11/cyrillic"

          FontPath     "/usr/share/fonts/X11/100dpi/:unscaled"

          FontPath     "/usr/share/fonts/X11/75dpi/:unscaled"

          FontPath     "/usr/share/fonts/X11/Type1"

          FontPath     "/usr/share/fonts/X11/100dpi"

          FontPath     "/usr/share/fonts/X11/75dpi"

          FontPath     "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"

          FontPath     "built-ins"



      Section "Module"

          Load  "glx"

          Load  "dbe"

          Load  "record"

          Load  "dri2"

          Load  "extmod"

          Load  "dri"



      Section "InputDevice"

          Identifier  "Keyboard0"

          Driver      "kbd"



      Section "InputDevice"

          Identifier  "Mouse0"

          Driver      "vmmouse"

      1.    Option        "Protocol" "auto"

      2.    Option        "Device" "/dev/input/mice"

      3.    Option        "ZAxisMapping" "4 5 6 7"



      Section "Monitor"

          Identifier   "Monitor0"

          VendorName   "Monitor Vendor"

          ModelName    "Monitor Model"



      Section "Device"


          1. Available Driver options are:-


          1. Values: <i>: integer, <f>: float, <bool>: "True"/"False",


          1. <string>: "String", <freq>: "<f> Hz/kHz/MHz"


          1. : arg optional

              Option     "SWcursor" "False"               #

              Option     "2DAccel" "True"                #

              Option     "DebugFallback" "False"          #

          Identifier  "Card1"

          Driver      "vmwgfx"

          VendorName  "VMware"

          BoardName   "Virtual Machine Communication Interface"

          BusID       "PCI:0:7:7"



      Section "Screen"

          Identifier "Screen0"

          Device     "Card0"

          Monitor    "Monitor0"

          SubSection "Display"

              Viewport   0 0

              Depth     15


          SubSection "Display"

              Viewport   0 0

              Depth     16


          SubSection "Display"

              Viewport   0 0

              Depth     24








      If you're lucky, you'll reboot with 2d acceleration partially or fully working (maybe you'll have better luck than me), and 3d stuff (such as compiz / GNOME desktop effects) should run flawlessly if you have fast enough hardware.



      Please dedicate this post to reporting your findings when you test this out. Note that compiling gallium and libdrm requires rather new versions of Xorg components and other parts of the system, so please use a very recent distro like Ubuntu 10.04 or Fedora 13.



        • 1. Re: [Linux guests] vmwgfx Testing
          s4n Novice

          I'm trying to vmwgfx under Gentoo, I've successfully compiled the latest development versions of mesa and libdrm, both with support for the vmware video card. I've also installed a recent X.Org X server (1.8.2) and the necessary xf86-video-vmware drivers and I've managed to enable gallium support for mesa; glxinfo gives me the following output:


          direct rendering: Yes

          server glx vendor string: SGI

          server glx version string: 1.4

          client glx vendor string: Mesa Project and SGI

          client glx version string: 1.4

          GLX version: 1.4

          OpenGL vendor string: VMware, Inc.

          OpenGL renderer string: Gallium 0.4 on softpipe

          OpenGL version string: 2.1 Mesa 7.9-devel

          OpenGL shading language version string: 1.20


          I've installed the VMware Tools and the vmwgfx kernel module, all modules are loaded as stated by lsmod:


          Module                  Size  Used by

          ttm                    30785  0

          vmblock                 7943  1

          vmhgfs                 37443  1

          vmci                   36728  1 vmhgfs

          vmwgfx                163966  1


          Here is the dmesg output:


          vmwgfx Initialized drm 1.1.0 20060810

          vmwgfx 0000:00:0f.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16


          vmwgfx Have 3D

          vmwgfx Initialized vmwgfx 1.3.0 20100723 for 0000:00:0f.0 on minor 0


          BUT, for some reason, it doesn't seem to work! The /var/log/Xorg.0.log contains the following messages:


          (II) LoadModule: "vmware"

          (II) Loading /usr/lib/xorg/modules/drivers/vmware_drv.so

          (II) Module vmware: vendor="X.Org Foundation"

              compiled for 1.8.2, module version = 11.0.2

              Module class: X.Org Video Driver

              ABI class: X.Org Video Driver, version 7.0

          (II) LoadModule: "vmwgfx"

          (WW) Warning, couldn't open module vmwgfx

          (II) UnloadModule: "vmwgfx"

          (EE) Failed to load module "vmwgfx" (module does not exist, 0)

          (EE) vmware: Please ignore the above warnings about not being able to to load module/driver vmwgfx

          (II) vmware: Using vmwlegacy driver everything is fine.

          (II) LoadModule: "vmwlegacy"

          (II) Loading /usr/lib/xorg/modules/drivers/vmwlegacy_drv.so

          (II) Module vmwlegacy: vendor="X.Org Foundation"

              compiled for 1.8.2, module version = 11.0.2

              Module class: X.Org Video Driver

              ABI class: X.Org Video Driver, version 7.0

          (II) vmwlegacy: driver for VMware SVGA: vmware0405, vmware0710


          The log (and glxgears performance) remains the same regardless the vmwgfx kernel module is loaded or not, it just seems to be ignored!?

          Gnome loads ok and I can work just fine, but I won't have 3D acceleration

          • 2. Re: [Linux guests] vmwgfx Testing
            allquixotic Enthusiast

            First problem is that it says you're using the softpipe driver.


            You need to set the 3DAccel option (symmetrical to the 2DAccel option) in Xorg.conf. And make sure that /usr/lib/dri/vmwgfx_dri.so and /usr/lib/xorg/modules/drivers/vmwgfx_drv.so exist. If not, then you configured something wrong during compile...

            • 3. Re: [Linux guests] vmwgfx Testing
              s4n Novice

              /usr/lib/dri/vmwgfx_dri.so exists (if I'm not wrong it was created when I installed mesa)


              Unfortunately I don't have /usr/lib/xorg/modules/drivers/vmwgfx_drv.so, I was already aware of that, but all my googling efforts resulted in vain. What is the package that should create it? I thought of xf86-video-vmware, because it creates vmware_drv.so & vmwlegacy_drv.so in /usr/lib/xorg/modules/drivers. Can you confirm me that (and maybe give me a hint for correct compiling)?


              Thank you!

              • 4. Re: [Linux guests] vmwgfx Testing
                allquixotic Enthusiast


                It's built from mesa/src/gallium/targets/xorg-vmwgfx






                • 5. Re: [Linux guests] vmwgfx Testing
                  s4n Novice

                  Thanks for the answer, I've had to tweak the ebuild for mesa, now /usr/lib/xorg/modules/drivers/vmwgfx_drv.so is created during mesa compilation.


                  The /var/log/Xorg.0.log confirms the driver being loaded:


                  (II) LoadModule: "vmwgfx"

                  (II) Loading /usr/lib/xorg/modules/drivers/vmwgfx_drv.so

                  (II) Module vmwgfx: vendor="X.Org Foundation"

                      compiled for 1.8.2, module version = 11.0.0

                      Module class: X.Org Video Driver

                      ABI class: X.Org Video Driver, version 7.0

                  (II) vmwgfx: Driver for VMware SVGA device: VMware SVGA Device


                  (II) vmwgfx(0): # Usefull debugging info follows #

                  (II) vmwgfx(0): ##################################

                  (II) vmwgfx(0): Using libkms backend

                  (II) vmwgfx(0): 2D Acceleration is disabled

                  (II) vmwgfx(0): Fallback debugging is disabled

                  (--) vmwgfx(0): 3D Acceleration is disabled

                  (==) vmwgfx(0): Swap Throttling is enabled.

                  (==) vmwgfx(0): Dirty Throttling is disabled.

                  (II) vmwgfx(0): ##################################


                  I couldn't enable the 2D/3D Acceleration no matter what options I tried in xorg.conf, any suggestions?


                  Plus, I still got this in glxinfo: "OpenGL renderer string: Gallium 0.4 on softpipe". Is there a way to switch the rendering on vmwgfx or am I still doing something wrong?

                  • 6. Re: [Linux guests] vmwgfx Testing
                    allquixotic Enthusiast

                    You'll need to post your entire xorg.conf and Xorg.0.log and dmesg (prefer a pastebin) for me to dig any deeper... you have the right files in place as far as I can tell:


                    *vmwgfx kernel module loaded

                    *vmwgfx dri module loaded (? or maybe there was a problem but you didn't post the full Xorg.0.log)

                    *vmwgfx Xorg DDX loaded (this is evident from the log you posted)


                    The fact you're getting the softpipe gallium driver suggests that you don't have the 2d/3daccel options set properly in xorg.conf, or maybe it's something deeper...


                    BTW, are you using an in-kernel vmwgfx in the staging tree, or are you using the out-of-tree vmwgfx from freedesktop.org? They don't appear to be equivalent, at least, as far as I can tell...


                    Just to confirm, you did create libdrm with the --enable-vmwgfx-experimental-api flag passed to configure, right?


                    The stack isn't that complicated in terms of separate compiles:


                    -kernel (vmwgfx)

                    -libdrm with --enable-vmwgfx-experimental-api

                    -mesa provides the Xorg DDX and the libGL and the vmwgfx_dri.so

                    • 7. Re: [Linux guests] vmwgfx Testing
                      s4n Novice

                      Ok, I did a little bit of cleaning and here's an update:


                      I used:

                      - kernel module {out-of-tree freedesktop (v1.3) & in-tree kernel (v1.0) both seem to work}

                      - libdrm 2.4.21 with --enable-vmwgfx-experimental-api

                      - mesa 7.8.2 with vmwgfx_dri.so & vmwgfx_drv.so being built


                      Finally the gallium driver is loaded as stated in /var/log/Xorg.0.log:


                      (II) vmwgfx(0): DRI2 Setup complete

                      (II) vmwgfx(0): DRI2   DRI driver: vmwgfx

                      (II) vmwgfx(0): ##################################

                      (II) vmwgfx(0): # Usefull debugging info follows #

                      (II) vmwgfx(0): ##################################

                      (II) vmwgfx(0): Using Gallium3D backend

                      (II) vmwgfx(0): 2D Acceleration is disabled

                      (II) vmwgfx(0): Fallback debugging is disabled

                      (II) vmwgfx(0): 3D Acceleration is enabled

                      (II) vmwgfx(0): ##################################


                      Enabling 2D Acceleration causes segmentation fault failing X to start.

                      The use of glxinfo/glxgears in Gnome again causes segmentation fault in the X system.


                      I'll try different versions of mesa/libdrm, but I guess I'll just have to wait for less experimental software


                      Thank you so much for the support!




                      Update 2: I reverted back to X.org X server 1.7.7, glxinfo/glxgears doesn't crash anymore:


                      OpenGL vendor string: VMware, Inc.

                      OpenGL renderer string: Gallium 0.4 on SVGA3D; build: RELEASE;

                      OpenGL version string: 2.1 Mesa 7.8.2


                      Can't really say the performance of glxgears increased very much, but I'm still happy!


                      Update 3: I just installed Compiz-Fusion: seems to work fine, I'll check for stability issues in the next few days.


                      Message was edited by: s4n

                      1 person found this helpful
                      • 8. Re: [Linux guests] vmwgfx Testing
                        allquixotic Enthusiast

                        Well, it's almost 2011, and vmwgfx still seems incapable of rendering correctly with 3d acceleration enabled.


                        If you set Option "3DAccel" "off" (the default) in xorg.conf, rendering is correct, but you have no 3d, so you may as well use vesa.


                        If you set Option "3DAccel" "on", you would expect to have an experience similar to the `r300g' driver, since it is also a gallium driver. But, unlike vmwgfx, r300g gets near-constant maintenance and fixes from a variety of interested parties, AMD and otherwise. Unlike r300g, a completely obvious bug goes unfixed for months with vmwgfx, and since the driver has no official homepage of means of contacting the developers, the bug will likely remain until (or if) someone at VMware decides to work on it.


                        See http://tiyukquellmalz.org/sean/vmware-corruption.jpg for an example of what happens (bad corruption) with 3DAccel enabled.


                        Strangely enough, compiz works flawlessly, but glxgears flickers badly. And rendered fonts sporadically display the wrong character. I was reading some text in Firefox, and wondered, "OTK+"? This must be a typo. But then I scrolled back and forth a few times and the "O" changed to a "G".


                        It's been like this since at least July, from what I can recall. And I've tried 2.6.35, 2.6.36, and 2.6.37-rc*, with the latest git master of the rest of the stack. Tried with and without compositing; with and without DebugFallback; with and without the full factorial of the xorg.conf options (DebugFallback, SwapThrottling, DirtyThrottling) toggled on and off. Also tried with and without an xorg.conf at all, and with 2DAccel disabled it's very very very slow (unusably slow).


                        It's sad, but the first hit in google for "vmwgfx" turns up this page... is this all we have for the unofficial homepage of vmwgfx, the premiere 3d acceleration solution for Linux guests? Really? Just a couple users saying "it doesn't work"?


                        This is kind of sad... I wish there were more work going into this driver.

                        • 9. Re: [Linux guests] vmwgfx Testing
                          stratman4300 Novice

                          Has anyone had luck with this running Gnome 3?

                          • 10. Re: [Linux guests] vmwgfx Testing
                            allquixotic Enthusiast

                            Actually, this driver hasn't worked at all for me since 2010! It used to at least partly work, but now 3d accel seems to be completely disabled, because all I can get is 2d + software rasterizer. I think the support for vmwgfx is going backwards; maybe they decided it's a bad idea and stopped trying to develop it. Or maybe they have 25,000 lines of shiny new code sitting in-house that they haven't released yet. I really don't know.


                            But right now, you won't get 3d accel with Unity, Gnome 2, Gnome 3, or anything else with vmwgfx. It's disabled.

                            • 11. Re: [Linux guests] vmwgfx Testing
                              apesa Lurker

                              Greetings all,


                              Whats the staus of this driver? I am in day 3 of a VMWare Workstation demo and still can't get tools installed in my Ubuntu guest.

                              • 12. Re: [Linux guests] vmwgfx Testing
                                sandikata Lurker

                                Hello, i'm trying to make work gentoo with vmwgfx, i have enabled vmwgfx in mesa and libdrm have vmwgfx.so in /usr/lib64/xorg/modules/drivers


                                But when try to start xorg no luck. Tryied any xorg.conf variants no luck. Any ideas?


                                Thanks in advance.

                                • 13. Re: [Linux guests] vmwgfx Testing
                                  celavey Novice

                                  same here. won't be able to activate Ubuntu guest for VMware. however, this is just my first day. will let you know if it will work on my end.https://imagicon.info/cat/5-59/vmware-cool.gif

                                  • 14. Re: [Linux guests] vmwgfx Testing
                                    djpalindrome Novice

                                    VMware, after having expressly asked Ubuntu to disable vmwgfx in their kernels [LP #606139], subsequently asked for CONFIG_DRM_VMWGFX=m to be re-enabled. This request [LP # 698009] was very recently incorporated into Oneiric kernel 3.0.0-9-13.


                                    Evidently vmwgfx was already enabled in Debian kernel 3.0.0-1, because I got both of them working using the same methods. Without building a custom kernel. Other distros I don't know about.


                                    This still seems to require a good deal of effort to get working, but at least not as much as building a custom kernel.


                                    Clone Mesa from git; build mesa with 'scons dri-vmwgfx xorg-vmwgfx'; copy the Gallium3D drivers you just built to standard library locations in X.Org's search path; then manually modify /etc/X11/xorg.conf to set 3DAccel "True".


                                    If there's now an easier way, I'd like to hear about it.

                                    1 2 Previous Next