VMware Communities
COREstorm
Contributor
Contributor

Workstation 9 - No 3D Acceleration to Guest - Ubuntu 12.04 Host - Nvidia Card

Ok, I've been going at this for some time.

Current Installation: Fresh install of Ubuntu 12.04

Video card: Nvidia Optimus GT540M

VMware: Workstation 9. (Unbuntu 12.04 is the HOST)

(Brief history: tried to get 3D support working under Workstation 8, using numerous nvidia drivers (every step you can find online), upgraded to Workstation 9 and retried all the steps. Reinstalled Ubuntu.);

Current status: Currently using Bumblebee. 3D WORKS on Ubuntu. I have glxinfo returning YES for 3D support and glxspheres working.

Since No nvidia drivers are installed, Vmware Workstation WILL NOT recognize the video card, and thus will not enable 3D support for the Windows 7 VM. - This is the problem we need to solve.

I have tried to uninstall Bumblebee and install Nvidia drivers and suffered from the 640x480 issue, with the Nvidia Settings not detecting a proper x configuration.

So the issue is currently: VMware will not recognize the video card properly since Bumblebee is installed. The 3D support will ONLY (so far) work using Bumblebee.

Let the delimma begin. This is currently a Vmware issue, although could quickly become another Ubuntu 12.04 issue if I have to go down the path of many drivers.

(Yes, I spent 9 hours trying to install every version of the Nvidia drivers everyone "suggested" with zero luck and many issues.)

112 Replies
james33
Contributor
Contributor

I TRIED THIS METHOD ON ANOTHER MACHINE WITH THE  SAME RESULTS AND I CAN SAY THAT IT DOESN'T WORK AT ALL, IT JUST DISABLE THE NO 3D HARWARE SUPPORT WARNING IN VMWARE BUT 3D ACCELERATION DOESN'T WORK

Reply
0 Kudos
rashm2k
Contributor
Contributor

james33 check the CPU usage when running BOTH. I noticed that my cpu usage was near zero with gpu acceleration and near 50%+ without when trying to run graphical effects.

Reply
0 Kudos
james33
Contributor
Contributor

I just checked and I have the same CPU usage


Do you also have this error when you run VMware trying with primurun ?

pastedImage_1.png

Reply
0 Kudos
ninjacoding
Contributor
Contributor

cmillersp wrote:

Ok, here's the guide to get vmware workstation working with nvidia acceleration.

ASSUMING: vmware workstation 9.0.1 or 8.0.5, ubuntu 12.10, optimus, working bumblebee config, x86_64 os.

If you don't have bumblebee set up yet, there are numerous tutorials to help you. Follow them.

1.  sudo apt-add-repository ppa:zhurikhin/primus

2. sudo apt-get update; sudo apt-get install primus primus-libs primus-libs:i386

3. Check that primus works. Try primusrun glxspheres.

4. If you don't have vmware installed, install it now.

5. sudo chmod a+s /usr/lib/x86_64-linux-gnu/primus/libGL.so.1

6. sudo ln -s /usr/lib/nvidia-current/tls/libnvidia-tls.so.304.43 /usr/lib/x86_64-linux-gnu/

sudo ln -s /usr/lib/nvidia-current/libnvidia-glcore.so.304.43 /usr/lib/x86_64-linux-gnu/
sudo ldconfig

7. sudo /etc/init.d/vmware stop

sudo mv /usr/lib/vmware/bin/vmware-vmx /usr/lib/vmware/bin/vmware-vmx.real

8. sudo gedit /usr/lib/vmware/bin/vmware-vmx
(paste in the following)

#!/bin/bash

LD_PRELOAD=/usr/lib/x86_64-linux-gnu/primus/libGL.so.1 exec primusrun /usr/lib/vmware/bin/vmware-vmx.real "$@"
9. sudo chmod u+s,a+x /usr/lib/vmware/bin/vmware-vmx
sudo /etc/init.d/vmware start
10. Run vmware, AS ROOT (sudo vmware)
11. Enjoy 3d acceleration.
So far, no crashes, decent performance.  Of course it's nowhere near an ideal solution, but it's the best I've been able to come up with at this point, and I'm really, really happy to have hardware acceleration.

Great work cmillersp.

Only now I had the chance to try this out... and it's working great.

Now it's possible to run from simple directx apps (2D games) and 3D heavy ones too (like ones using pixel shaders and such).

Whereas before neither worked with WS 9.

It seems that for heavier games (I only tested one so far, and it wasn't that heavy, it's a TB game) it still doesn't run as fluid as one would want.

And it eats up a lot of CPU resources. I'm guessing part of it is from the game itself, while the other part is probably due to all the interface layers involved.

But you can see the difference when running a 2D adventure game (like Resonance) and a 3D one (like Age of Decadence). Both CPU wise and GPU wise (with optirun nvidia-settings -c :8).

FWIW, I also get these errors:

Xlib:  extension "NV-GLX" missing on display ":0".

Will have to investigate it latter on.

Reply
0 Kudos
kaed
Contributor
Contributor

I tried your solution with LinuxReCon's fix but I still don't have 3d acceleration.

I  have a Dell Inspiron N7110 (GeForce GT 525M/PCIe/SSE2) running Ubuntu  12.10 64bit with VMware Workstation 9.0.1-894247.  And on VW I'm trying  to get 3d acceleration (aero + directx features working) on a Windows 7  Home Premium 64bit machine.

My VMs Specs:

Memory: 2gb

Processors: 4

Hard Disk: 30gb

Display: Auto Detect

Here's what I typed in the terminal and the output:

code@code-PC:~/Desktop$ sudo chmod a+s /usr/lib/x86_64-linux-gnu/primus/libGL.so.1
code@code-PC:~/Desktop$ sudo ln -s /usr/lib/nvidia-current/tls/libnvidia-tls.so.304.64 /usr/lib/x86_64-linux-gnu/
code@code-PC:~/Desktop$ sudo ln -s /usr/lib/nvidia-current/libnvidia-glcore.so.304.64 /usr/lib/x86_64-linux-gnu/
code@code-PC:~/Desktop$ sudo ldconfig
code@code-PC:~/Desktop$ sudo /etc/init.d/vmware stop
Stopping VMware services:
   VMware Authentication Daemon                                        done
   VM communication interface socket family                            done
   Virtual machine communication interface                             done
   Virtual machine monitor                                             done
   Blocking file system                                                done
code@code-PC:~/Desktop$ sudo mv /usr/lib/vmware/bin/vmware-vmx /usr/lib/vmware/bin/vmware-vmx.real
code@code-PC:~/Desktop$ sudo gedit /usr/lib/vmware/bin/vmware-vmx
code@code-PC:~/Desktop$ sudo chmod u+s,a+x /usr/lib/vmware/bin/vmware-vmx
code@code-PC:~/Desktop$ sudo /etc/init.d/vmware start
Starting VMware services:
   Virtual machine monitor                                             done
   Virtual machine communication interface                             done
   VM communication interface socket family                            done
   Blocking file system                                                done
   Virtual ethernet                                                    done
   VMware Authentication Daemon                                        done
   Shared Memory Available                                             done
code@code-PC:~$ sudo vmware

(vmware-modconfig:7906): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

[(^This pops up a bunch more)]

(vmware-modconfig:7906): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(vmware-modconfig:7906): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",
Gtk-Message:  Failed to load module "canberra-gtk-module": libcanberra-gtk-module.so:  cannot open shared object file: No such file or directory
Logging to /tmp/vmware-root/vmware-modconfig-7906.log
filename:       /lib/modules/3.5.0-25-generic/misc/vmmon.ko
supported:      external
license:        GPL v2
description:    VMware Virtual Machine Monitor.
author:         VMware, Inc.
srcversion:     9342145FB4C112347AF67BE
depends:       
vermagic:       3.5.0-25-generic SMP mod_unload modversions

(vmware-tray:7988): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

[(^This pops up a bunch more)]

(vmware-tray:7988): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(vmware-tray:7988): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",
Gtk-Message:  Failed to load module "canberra-gtk-module": libcanberra-gtk-module.so:  cannot open shared object file: No such file or directory

(vmware-unity-helper:8498): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

[(^This pops up a bunch more)]

(vmware-unity-helper:8498): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(vmware-unity-helper:8498): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",
Gtk-Message:  Failed to load module "canberra-gtk-module": libcanberra-gtk-module.so:  cannot open shared object file: No such file or directory
Xlib:  extension "NV-GLX" missing on display ":0".
2013-02-26 20:14:26  9097 no printer configured or none available
2013-02-26 20:14:26  9109 adaptor daemon booted
2013-02-26 20:14:26  9112 connector "vmlocal" booted
Xlib:  extension "NV-GLX" missing on display ":0".
Xlib:  extension "NV-GLX" missing on display ":0".
Xlib:  extension "NV-GLX" missing on display ":0".
Xlib:  extension "NV-GLX" missing on display ":0".
2013-02-26 20:22:51  9109 adaptor daemon shut down
2013-02-26 20:22:51  9112 connector "vmlocal" shut down

Here's a screeny of when I tried powering my vm on after running sudo vmware:

http://i.imgur.com/HWH36BP.png

Things I have checked/tried:

  • Checked: libcanberra-gtk3-module is installed and updated to the latest version
  • Tried:  sudo apt-get install nvidia-experimental-310 (currently using  nvidia-current) only to get the following: http://i.imgur.com/QllGZVr.png
  • Tried: uninstalling and  reinstalling vmware only to notice that the: Failed to load module  "canberra-gtk-module"   shows up on both the uninstallation and  reinstallation.
  • Checked: The output for optirun glxspheres is:
Polygons in scene: 62464
Visual ID of window: 0x21
Context is Direct
OpenGL Renderer: GeForce GT 525M/PCIe/SSE2
117.786601 frames/sec - 131.449847 Mpixels/sec
123.078047 frames/sec - 137.355100 Mpixels/sec
  • Checked: The output for primusrun glxspheres is:
Polygons in scene: 62464
Visual ID of window: 0xb9
Context is Direct
OpenGL Renderer: GeForce GT 525M/PCIe/SSE2
60.639464 frames/sec - 67.673642 Mpixels/sec
59.796828 frames/sec - 66.733260 Mpixels/sec
  • Checked: The output for vblank_mode=0 primusrun glxspheres:
Polygons in scene: 62464
ATTENTION: default value of option vblank_mode overridden by environment.
ATTENTION: default value of option vblank_mode overridden by environment.
Visual ID of window: 0xb9
Context is Direct
OpenGL Renderer: GeForce GT 525M/PCIe/SSE2
ATTENTION: default value of option vblank_mode overridden by environment.
ATTENTION: default value of option vblank_mode overridden by environment.
ATTENTION: option value of option vblank_mode ignored.
212.256030 frames/sec - 236.877729 Mpixels/sec
221.688264 frames/sec - 247.404102 Mpixels/sec
  • Tried:  adding vblank_mode=0 before the primusrun in the vmware-vmx file only  to get the error that the vblank_mode=0 module didn't exist.  And I  couldn't even power on the machine.

What am I doing wrong and what can I try to do to fix this?  Any help is greatly appreciated.

Reply
0 Kudos
kantor
Contributor
Contributor

cmillersp wrote:

Ok, here's the guide to get vmware workstation working with nvidia acceleration.

ASSUMING: vmware workstation 9.0.1 or 8.0.5, ubuntu 12.10, optimus, working bumblebee config, x86_64 os.

If you don't have bumblebee set up yet, there are numerous tutorials to help you. Follow them.

1.  sudo apt-add-repository ppa:zhurikhin/primus

2. sudo apt-get update; sudo apt-get install primus primus-libs primus-libs:i386

3. Check that primus works. Try primusrun glxspheres.

4. If you don't have vmware installed, install it now.

5. sudo chmod a+s /usr/lib/x86_64-linux-gnu/primus/libGL.so.1

6. sudo ln -s /usr/lib/nvidia-current/tls/libnvidia-tls.so.304.43 /usr/lib/x86_64-linux-gnu/

sudo ln -s /usr/lib/nvidia-current/libnvidia-glcore.so.304.43 /usr/lib/x86_64-linux-gnu/
sudo ldconfig

7. sudo /etc/init.d/vmware stop

sudo mv /usr/lib/vmware/bin/vmware-vmx /usr/lib/vmware/bin/vmware-vmx.real

8. sudo gedit /usr/lib/vmware/bin/vmware-vmx
(paste in the following)

#!/bin/bash

LD_PRELOAD=/usr/lib/x86_64-linux-gnu/primus/libGL.so.1 exec primusrun /usr/lib/vmware/bin/vmware-vmx.real "$@"
9. sudo chmod u+s,a+x /usr/lib/vmware/bin/vmware-vmx
sudo /etc/init.d/vmware start
10. Run vmware, AS ROOT (sudo vmware)
11. Enjoy 3d acceleration.
So far, no crashes, decent performance.  Of course it's nowhere near an ideal solution, but it's the best I've been able to come up with at this point, and I'm really, really happy to have hardware acceleration.

The solution by cmillersp worked only once in Mint 14. After rebooting the VM it keeps says "Error: Virtual machine is busy" at launch, this is the errors i get in the shell:

sudo /usr/bin/vmplayer

Logging to /tmp/vmware-root/vmware-modconfig-1351.log

filename:       /lib/modules/3.7.0-7-generic/misc/vmmon.ko

supported:      external

license:        GPL v2

description:    VMware Virtual Machine Monitor.

author:         VMware, Inc.

srcversion:     371FC822A8256C65D5E700F

depends:      

vermagic:       3.7.0-7-generic SMP mod_unload modversions

connect: No such file or directory

primus: fatal: failure contacting Bumblebee daemon

when i try to start the bumblebeed i get this:

[ERROR]Invalid configuration: no driver configured.

Anyway the problem is solved reversing the 7th step:

sudo mv /usr/lib/vmware/bin/vmware-vmx /usr/lib/vmware/bin/vmware-vmx.real

of course this implies no 3D in the virtual machine. Anyone have this problem? Anyone have an idea about it? could be a problem with Bumblebee?

Reply
0 Kudos
skzr
Contributor
Contributor

Thanks, you are right!

enable 3D it's good: Ubuntu Forums

my card:core i7-3630QM and NVIDIA Geforce GTX660M

Reply
0 Kudos
JeeKTan
Contributor
Contributor

docsmooth wrote:

These instructions worked great for my new Lenovoa T430 running Kubuntu 12.10, Thank you!

I thought I could add a bit as well: since I'm kind of a battery runtime nut, I want to be able to only run VMware under the Nvidia driver sometimes, so I scripted it with intelligence.  Full writeup, and the script, are here: http://www.totalnetsolutions.net/2012/12/08/bumblebee-primus-and-vmware-workstation-nvidia-optimus-g...

I'm hoping to add in the SuSE notes from this thread, perhaps tomorrow morning, and am actively interested in feedback, to make it maybe the first useful thing I've added to this community I've so far taken so much from.

Thanks again, cmillersp!

Unfortunately, the script in the link posted doesn't work for latest Ubuntu version as they have deprecated nvidia-current. I have uploaded the updated script attached to this Dropbox link here (Extract the zip file). Once extracted, run the following commands on Terminal:

sudo ./bumblebee-vmware.sh --install

sudo ./bumblebee-vmware.sh

Make sure you have install primusrun and nvidia-319-updates before running the script. If you're using other nvidia driver versions, open the script as gedit and go to line 110, replacing export PRIMUS_libGLa='/usr/lib/nvidia-319-updates/libGL.so.1' with export PRIMUS_libGLa='/usr/lib/[NVIDIA DRIVER PACKAGE NAME HERE]/libGL.so.1'


You must always run the script as sudo if you want to get 3D acceleration from your Nvidia card and this script also detects if the laptop is plugged in or not. If you want to get 3D acceleration when you're on battery add the -y flag at the end of the command after install. The bug Xlib:  extension "NV-GLX" missing on display ":0.0". still persists on the Terminal log however.


This script is tested on VMWare Workstation 10 on Ubuntu 13.10 (64 bit) with nvidia-319-updates driver.


Credits to docsmooth for providing the original script.



Reply
0 Kudos
alfito2012
Contributor
Contributor

Works!

Reply
0 Kudos
docsmooth
Enthusiast
Enthusiast

Hey, JeeKTan, thanks for the update - I'm going through it right now, but it looks like I hadn't updated by blog post as often as I had my own copy.  I moved the code into github.  I'm running through your changes compared to mine, but I've moved up to v1.3, and your edits are against 1.1.

What appears to be the main difference is on line 110 and 111 and 198 to 199, right?  I have them commented out right now, and things *are* working on my 13.10 box, so I'm not sure if they're still required in other cases?  I only have the 1 test machine.

I've also updated to the 13.10 acpi paths for my version, but there's a lot I'd like to do to this to make it more workable for others.  I'd love your input, just send a pull request.

https://github.com/docsmooth/vmware-bumblebee

Rob A Deployments PM: www.likewise.com Co-Owner: www.totalnetsolutions.net
Reply
0 Kudos
sandkh
Contributor
Contributor

Hey docsmooth - I've been playing with this for a while and still not quite there.  The notebook I am working on is running Ubuntu GNOME 14.04 amd64 with an Intel HD4000 and NVIDIA GeForce 635m.  I have the xorg edgers repo ppa:xorg-edgers/ppa updated with nvidia-337 libcuda1-337 nvidia-opencl-icd-337 bumblebee bumblebee-nvidia and primus installed.  I just did a fresh install of VMware Workstation 10.0.3 64 bit and  I also edited your current script from github and replaced 304 with 337.  I ran it as sudo and this was my result:

user@x:~$ sudo sh /home/user/Downloads/vmware-bumblebee-master/vmware --yes

forcing 3d on

/home/user/Downloads/vmware-bumblebee-master/vmware: 287: /home/user/Downloads/vmware-bumblebee-master/vmware: -k: not found

Any ideas?  I have 3 of these notebooks to get working.  I used to get optirun to work with Workstation when running it as root from the terminal (which was screwing up all kinds of permissions), but now that doesn't work either.

Reply
0 Kudos
docsmooth
Enthusiast
Enthusiast

Fixed on github, thanks for letting me know! https://github.com/docsmooth/vmware-bumblebee/commit/fa6658b0631f45bbeab9317853e092527892f159

Rob A Deployments PM: www.likewise.com Co-Owner: www.totalnetsolutions.net
Reply
0 Kudos
dmgeurts
Enthusiast
Enthusiast

What results should I get when checking openGL support on the guest vm? The following is what I get on vmware workstation preview edition 2015. I tried the preview as it stated openGL 3.3 support. The out put remains the same whether running it prior to your script, with optirun from cli or without anything.

VMware openGL 2.1 Mesa 10 2015-08-04 22_37_23.png

djerk@djerk-W540:~/bin$ optirun glxinfo | grep -i openGL

OpenGL vendor string: NVIDIA Corporation

OpenGL renderer string: Quadro K1100M/PCIe/SSE2

OpenGL core profile version string: 4.3.0 NVIDIA 340.76

OpenGL core profile shading language version string: 4.30 NVIDIA via Cg compiler

OpenGL core profile context flags: (none)

OpenGL core profile profile mask: core profile

OpenGL core profile extensions:

OpenGL version string: 4.4.0 NVIDIA 340.76

OpenGL shading language version string: 4.40 NVIDIA via Cg compiler

OpenGL context flags: (none)

OpenGL profile mask: (none)

OpenGL extensions:

Reply
0 Kudos