VMware Communities
allquixotic
Enthusiast
Enthusiast

[Linux guests] vmwgfx Testing

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"

EndSection

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"

EndSection

Section "Module"

Load "glx"

Load "dbe"

Load "record"

Load "dri2"

Load "extmod"

Load "dri"

EndSection

Section "InputDevice"

Identifier "Keyboard0"

Driver "kbd"

EndSection

Section "InputDevice"

Identifier "Mouse0"

Driver "vmmouse"

  1. Option "Protocol" "auto"

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

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

EndSection

Section "Monitor"

Identifier "Monitor0"

VendorName "Monitor Vendor"

ModelName "Monitor Model"

EndSection

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"

EndSection

Section "Screen"

Identifier "Screen0"

Device "Card0"

Monitor "Monitor0"

SubSection "Display"

Viewport 0 0

Depth 15

EndSubSection

SubSection "Display"

Viewport 0 0

Depth 16

EndSubSection

SubSection "Display"

Viewport 0 0

Depth 24

EndSubSection

EndSection

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.

Reply
0 Kudos
21 Replies
s4n
Contributor
Contributor

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 Smiley Sad

Reply
0 Kudos
allquixotic
Enthusiast
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...

Reply
0 Kudos
s4n
Contributor
Contributor

/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! Smiley Happy

Reply
0 Kudos
allquixotic
Enthusiast
Enthusiast

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

Reply
0 Kudos
s4n
Contributor
Contributor

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?

Reply
0 Kudos
allquixotic
Enthusiast
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

Reply
0 Kudos
s4n
Contributor
Contributor

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 Smiley Wink

Thank you so much for the support! Smiley Happy

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

allquixotic
Enthusiast
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". :smileygrin:

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.

Reply
0 Kudos
stratman4300
Contributor
Contributor

Has anyone had luck with this running Gnome 3? :smileyconfused:

Reply
0 Kudos
allquixotic
Enthusiast
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.

Reply
0 Kudos
apesa
Contributor
Contributor

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.

Reply
0 Kudos
sandikata
Contributor
Contributor

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.

Reply
0 Kudos
celavey
Enthusiast
Enthusiast

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

Reply
0 Kudos
djpalindrome
Enthusiast
Enthusiast

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.

Reply
0 Kudos
djpalindrome
Enthusiast
Enthusiast

The guidelines I have been using came from here:

[Mesa-dev] The current status of the gallium vmwgfx driver:

http://lists.freedesktop.org/archives/mesa-dev/2011-May/007611.html

This approach worked flawlessly for me until xorg-vmwgfx recently [29-30 September 2011] vanished from git:

xorg/vmwgfx: Kill this target. It's not used anymore:

This fixes a build error introduced with commit "winsys/svga: Update to vmwgfx kernel module 2.1" if both the svga driver and the xorg state tracker was enabled at the same time. If needed we can re-add a minimal target for basic functionality.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>


[http://cgit.freedesktop.org/mesa/mesa/commit/?id=d742a64909b2b414fc94b6f525a13ce09ca7f9f7]

What does this mean; that I really never needed it in the first place? If so, why was I building it?

Well, I think it is needed, at least by me, because while VMware still provides no 'official' support for direct rendering in Linux guests, even in WS8, their functionaries seem to be busy undermining 'unofficial' support.

It would be really nice to have a statement from VMware Corporate. I don't care what they officially support or do not support, nor when they will or will not support anything. One of their functionaries is responsible for pulling it from git. Surely they can be held accountable for that much.

Reply
0 Kudos
chemical
Contributor
Contributor

I was running over the same problem. I tried to build vmwgfx_drv.so from mesa git and found the mentioned commit that removes the target I need to create the driver.

Is it possible to stay at git head but revert his commit with the hash d742a64909b2b414fc94b6f525a13ce09ca7f9f7?

Anyway - I found that, even if I go before that commit, the driver won't compile because of a not defined constant DRM_VMW_UPDATE_LAYOUT in src/gallium/winsys/svga/drm/vmwgfx_drm.h.

I had to move further back right before the commit  e63f2787b6a8dd7ff7a093fea8017a0b74cac6fd (update gallium svga to 2.1) which seems to create inconsistencies regarding the code.

Before that commit, it compiles as expected - but seems to crash in X later on.

Maybe we're doing something wrong? Did you ask Thomas in the meantime?

EDIT: Added new knowledge to the post.

Reply
0 Kudos
djpalindrome
Enthusiast
Enthusiast

Jakob [Bornecrantz] was nice enough to send me the following reply.

To be perfactly honest, I think I'm out of my depth, so I haven't tried it (I don't think I know how).

Let me just quote him verbatim:

"We are working on improving the driver and as such have reorganized
the driver, deprecated a couple of things, moved things around and
require the latest Fusion/Workstation/Player release[1] to get 3D.
2D only will work just fine with a older release.


First you need to get mesa git master, build it and then install it
with the --enable-xa flag given.

./configure --prefix=/usr --enable-xa --with-gallium-drivers=svga

You can add "--with-dri-drivers= --disable-egl --disable-glu --disable-glw"
to only build what is needed.


We moved the xorg driver to the xf86-video-vmware repository:
http://cgit.freedesktop.org/xorg/driver/xf86-video-vmware/log/?h=vmwgfx_branch
Remember to check out the vmwgfx_branch branch, it might be a bit hard
to spot it in the configure log but:
"checking for XATRACKER... yes"
is what you are looking for to tell you that it is building the new driver.


Also remember to run with the latest kernel driver that supports the 2.1
interface, you can get that from the same place as before. Currently we
are upstreaming these changes as we speak, but currently only the
standalone repository is available."


Reply
0 Kudos
ruymbeke
Enthusiast
Enthusiast

Hello,

I am yet another VmWare Workstation 8.0 user trying to get video acceleration on a Linux guest,

more precisely a remaster of Knoppix 6.7.1 guest running on a Windows 7 host. (I know: why do that...)

The main reason for this is that we just found out that the compilation time of our build machine is actually

much (about twice) longer than running on the bare metal, because of ... the SLOW VMWARE DISPLAY emulation !

Basically just the scrolling of the build log in a shell window slows down the whole build.

Using a smaller size console window or just adding a ">/dev/null" speed up the build big time (ratio of two)

So I am very motivated to add video hardware accelaration to my Linux guest.

I spend the whole day following various forum threads on the internet to find out that

the folder to create the xorg driver vmwgfx_drv.so has been removed from the mesa source tree.

I finally end up in this forum and so far I got mesa (from git) to compile and

install the dri module properly (after installing a lot of missing development packages):


git clone git://anongit.freedesktop.org/mesa/mesa
cd mesa
./configure --prefix=/usr --enable-xa --with-gallium-drivers=svga
make; make install

but I cannot compile the xf86-video-vmware driver from it's repository:

git clone git://anongit.freedesktop.org/xorg/driver/xf86-video-vmware

cd xf86-video-vmware

./configure

I get the following errors:

./configure: line 11256: syntax error near unexpected token `RANDR,'
./configure: line 11256: `XORG_DRIVER_CHECK_EXT(RANDR, randrproto)'

Any idea ? Thanks for your help,

Gilles

PS: Is it still possible to get 2D and 3D acceleration on a Linux guest under vmware ?

I thougth that the highlights of vmware Workstation 8 was to have "better" 2D and 3D support...

BTW the latest vmware tools included with Workstation 7.1.5 do not even compile on a new (3.0.4) kernel.

Reply
0 Kudos
hagardunor
Contributor
Contributor

Hi all,

I can report a successful build of vmwgfx on a Gentoo guest.

I've used the "9999" versions of libdrm, mesa and xf86-video-vmware ebuilds from the x11 overlay. I had to patch the mesa ebuild, and force the "--enable-xa" configuration option. Then the xf86-video-vmware emerge from the main branch was able to detect the "xa tracker".

Extract from the X log :

[    19.097] (II) vmware(0): Initialized VMWARE_CTRL extension version 0.2
[    19.126] (II) vmware(0): Gallium3D XA version: 1.0.0.
[    19.126] (II) vmware(0): Path of drm device is "/dev/dri/card0".
[    19.126] (II) vmware(0): [DRI2] Setup complete
[    19.126] (II) vmware(0): [DRI2]   DRI driver: vmwgfx
[    19.126] (--) vmware(0): Render acceleration is enabled.
[    19.126] (==) vmware(0): Rendercheck mode is disabled.
[    19.126] (--) vmware(0): Direct rendering (3D) is enabled.

The acceleration is really nice, it makes a Linux desktop guest a pleasure to use.

Cheers

Reply
0 Kudos