1 4 5 6 7 8 Previous Next 112 Replies Latest reply on Aug 5, 2015 6:03 AM by dmgeurts Go to original post
      • 75. Re: Workstation 9 - No 3D Acceleration to Guest - Ubuntu 12.04 Host - Nvidia Card
        cmillersp Novice

        I don't know how that would work, though. Even with xen, if I'm not mistaken, when you use passthrough to use another card, you have to hook an additional monitor up to that card to use it.  We'd still need some ugly hack along the lines of hybrid-windump, even with passthrough to windows, but it would seem even more complicated.

         

        I've been considering giving up, running windows natively, and virtualizing linux, but that's not very fun, and then I lose performance on the OS I actually use for most things.  It might be more fun to just go buy a notebook with AMD graphics.  I also need to see what I can get out of VirtualBox.

         

        In the meantime, if you can figure out a way to use primusrun, since it isn't VGL, it might work somehow.  I wouldn't be too optimistic, though, because it supports even less opengl functions than virtualgl does.  But we'll have to see!  I just can't seem to make it load primusrun's version OR nvidia's version of libGL.so.1, so let me know if you can!

        • 76. Re: Workstation 9 - No 3D Acceleration to Guest - Ubuntu 12.04 Host - Nvidia Card
          goomba000 Novice

          cmillersp wrote:

           

          I don't know how that would work, though. Even with xen, if I'm not mistaken, when you use passthrough to use another card, you have to hook an additional monitor up to that card to use it.  We'd still need some ugly hack along the lines of hybrid-windump, even with passthrough to windows, but it would seem even more complicated.

           

          Not necessarily.  We use hybrid-windump because we want to run something on a different X server but on the same display (say, in a sort of "window" overlayed on top which is near impossible to move).  However, for a virtual machine, I wouldn't mind running it in a different virtual console where the X server has exclusive access to the nvidia card so you switch to the that display the usual way (ctrl+alt+F8).  Of course then you don't have the benefit of drag-n-drop with vmtools or unity (which I never used), and also you can't run anything on the nvidia card (with optirun) on the first display, but I think those inconveniences are offset by the massive advantage of direct access to the card by the VM and full DirectX functionality, with no speed penalty.

          In the meantime, if you can figure out a way to use primusrun, since it isn't VGL, it might work somehow.  I wouldn't be too optimistic, though, because it supports even less opengl functions than virtualgl does.  But we'll have to see!  I just can't seem to make it load primusrun's version OR nvidia's version of libGL.so.1, so let me know if you can!

          I'm gonna try later tonight.  I haven't thought at lenght of the problems that might arise using VGL instead of X directly, I think it might be worth a try to disable the intel chip completely and run X on the nvidia card if that's possible.  I don't hold much hope of something functional either way with VMWare though.  In any case, for me one of the reasons I wanted to try it is that I would have liked to be able to play old win9x games that require 3D, but I realized a few days ago that it only works for XP+ (NT/2000? haven't tried), which is too bad.  Another area where VGA passthrough might be useful.  And I really don't want to dual-boot such an OS (and find drivers/etc).

          • 77. Re: Workstation 9 - No 3D Acceleration to Guest - Ubuntu 12.04 Host - Nvidia Card
            cmillersp Novice

            As much as I hate to say this, running the nVidia card only is not possible without a hardware mux.  The nVidia hardware is not and can never be connected directly to the display, with the exception of laptops with a hardware mux (Thinkpad W series for instance).  With optimus, the only thing which can directly display is the intel card, which the nVidia card must use to display whatever it rendered.

             

            This is also the reason that even if we get PCI-passthrough on a VM, nothing will display on the screen.  The intel card still has to somehow display what the nVidia card rendered.  We can do this now with vnc, for example, and running a second X session on the nVidia card.  The problem with that is, performance is bad, hence the existance of hybrid-windump, which, I think, should be worked on and perfected so that we can get native nVidia features.

            • 78. Re: Workstation 9 - No 3D Acceleration to Guest - Ubuntu 12.04 Host - Nvidia Card
              goomba000 Novice

              Hmmm you're right.  Well that is an unfortunate situation.  I had hoped that it would have been possible to still dedicate the nvidia card to the guest while using the intel display buffer transparently through some voodoo hackery.   Curse the day I bought this laptop...  Lower power consumption be damned, it isn't worth the trouble.

              • 79. Re: Workstation 9 - No 3D Acceleration to Guest - Ubuntu 12.04 Host - Nvidia Card
                cmillersp Novice

                An update:

                I have 3d from nvidia card working with no crashing... in VMWare 8.0.5, though.  But I got over 8000 3dmarks in 3dmark 03, and I can confirm it's working, using primusrun.  afaik, it needs to be run as root.

                 

                I'm currently looking into trying this on Vmware WS 9.0.1 and will let everyone know when I have something to share.  Worst case scenario, we will at least have fully working nvidia-accel on VMWare 8, which, afaik, we haven't had yet.

                 

                Edit:

                Yes, it works on VMWare 9 as well.  I will come up with a tutorial tonight or tomorrow when I have time, but it works!  If you don't want to wait for the tutorial, your vmware-vmx file should look like this,

                 

                #!/bin/bash

                LD_PRELOAD=/usr/lib/x86_64-linux-gnu/primus/libGL.so.1 exec primusrun /usr/lib/vmware/bin/vmware-vmx.real "$@"

                 

                 

                You need to have primus installed from its ppa, and you need to run sudo vmware.  It will give some errors when it runs, such as

                 

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

                but... there has been no crashing so far.  Will report later if any.

                 

                I think 8.0.5 may be better in terms of 3d performance in this case, as I can't get more than 6500 in 3dmark 03 on vmware 9.

                • 80. Re: Workstation 9 - No 3D Acceleration to Guest - Ubuntu 12.04 Host - Nvidia Card
                  cmillersp Novice

                  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.
                  • 81. Re: Workstation 9 - No 3D Acceleration to Guest - Ubuntu 12.04 Host - Nvidia Card
                    goomba000 Novice

                    Works for me too, well done!

                     

                    Any idea why we need to run vmware as root?  I did set /usr/lib/x86_64-linux-gnu/primus/libGL.so.1 setuid root but it still doesn't load when I run vmware as a user and I don't have any relevant output on the terminal.

                    • 82. Re: Workstation 9 - No 3D Acceleration to Guest - Ubuntu 12.04 Host - Nvidia Card
                      cmillersp Novice

                      With primusrun and setuid binaries this is always the case, as far as I can tell.  I'm not sure that setuid'ing the libGL library makes a difference. I have to play with it more. However, this does give the benefit of letting one use the intel card when wanted by not running vmware as root.

                       

                      I think this may be as good as we'll get, but I'm still thrilled to be able to use hardware acceleration with VMs at all.  I'll try to look into a non-root solution, but I don't think the outcome looks too great, as any fix would likely involve lots of hacky stuff.

                      • 83. Re: Workstation 9 - No 3D Acceleration to Guest - Ubuntu 12.04 Host - Nvidia Card
                        goomba000 Novice

                        cmillersp wrote:

                         

                        With primusrun and setuid binaries this is always the case, as far as I can tell.  I'm not sure that setuid'ing the libGL library makes a difference. I have to play with it more. However, this does give the benefit of letting one use the intel card when wanted by not running vmware as root.

                         

                        I think this may be as good as we'll get, but I'm still thrilled to be able to use hardware acceleration with VMs at all.  I'll try to look into a non-root solution, but I don't think the outcome looks too great, as any fix would likely involve lots of hacky stuff.

                        Indeed, I just spoke to amonakov.  primusrun relies on LD_LIBRARY_PATH and setuid root executables don't have access to it (for security reasons).  One possible workaround suggested by amonakov would have been to simply make /usr/lib/x86_64-linux-gnu/primus/libGL.so.1 the "system-wide" libGL.so.1 by putting it in ld.so.conf (and removing the others or putting them lower priority), but then you have to use it for everything, and after testing it, VMWare complains that a bunch of glx functions are not present (vmware needs a whole bunch which are not implemented in primus), so LD_LIBRARY_PATH is required to have fallback libGL.so.1's (nvidia's or mesa's).

                         

                        So in short this is as good as it gets for now.

                         

                        Cheers

                        • 84. Re: Workstation 9 - No 3D Acceleration to Guest - Ubuntu 12.04 Host - Nvidia Card
                          rashm2k Novice

                          Excelent cmillersp!

                           

                          primusrun works perfectly well for me!!!!! At least I get some 3D goodness offloaded to the GFX, windows is then usable.

                           

                          I'm using openSUSE 12.2, I installed primusrun from openSUSE repo and then needed to tweak the run script to add this:

                           

                          LD_PRELOAD=/usr/lib64/nvidia/tls/libnvidia-tls.so.310.19:/usr/lib64/primus/libGL.so.1:/usr/lib64/nvidia/libnvidia-glcore.so.310.19 exec primusrun /usr/lib/vmware/bin/vmware-vmx.real "$@"

                           

                          because the locations are not same as ubuntu.

                          • 85. Re: Workstation 9 - No 3D Acceleration to Guest - Ubuntu 12.04 Host - Nvidia Card
                            LinuxReCon Lurker

                            Well, this does not work for me here, I get the following output, when I'm trying to start a Virtual Machine:

                             

                            sudo vmware
                            Logging to /tmp/vmware-root/vmware-modconfig-8130.log
                            filename:       /lib/modules/3.5.0-19-generic/misc/vmmon.ko
                            supported:      external
                            license:        GPL v2
                            description:    VMware Virtual Machine Monitor.
                            author:         VMware, Inc.
                            srcversion:     9342145FB4C112347AF67BE
                            depends:       
                            vermagic:       3.5.0-19-generic SMP mod_unload modversions
                            »/desktop/gnome/interface/menus_have_tearoff« wurde kein Wert zugewiesen
                            Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.
                            primus: fatal: failed to load any of the libraries: /usr/lib/nvidia-current/libGL.so.1:/usr/lib32/nvidia-current/libGL.so.1
                            libnvidia-tls.so.304.64: cannot open shared object file: No such file or directory
                            /usr/lib32/nvidia-current/libGL.so.1: wrong ELF class: ELFCLASS32

                             

                             

                            Also, at the "sudo ldconfig" step, the symbolic links which are created before (ln -s) are gone. What's wrong here?

                            • 86. Re: Workstation 9 - No 3D Acceleration to Guest - Ubuntu 12.04 Host - Nvidia Card
                              rashm2k Novice

                              LinuxReCon the problem is that you are linking to the 32 bit libs but you have the 64 bit vmware.

                               

                              my /usr/lib/vmware/bin/vmware-vmx file looks like this:

                               

                              #!/bin/bash


                              LD_PRELOAD=/usr/lib64/nvidia/tls/libnvidia-tls.so.310.19:/usr/lib64/primus/libGL.so.1:/usr/lib64/nvidia/libnvidia-glcore.so.310.19 exec primusrun /usr/lib/vmware/bin/vmware-vmx.real "$@"

                               

                               

                              and then I have a script to start vmware which looks like this:

                               

                               

                              #!/bin/bash

                               

                              export PRIMUS_libGLa='/usr/lib64/nvidia/libGL.so.1'
                              export LD_LIBRARY_PATH=/usr/lib64/nvidia:/usr/lib/nvidia:/usr/lib64/nvidia/tls:/usr/lib/nvidia/tls

                               

                              #this is to get sudo to work properly with vmware
                              export XAUTHORITY=/home/USERNAME/.Xauthority
                              XAUTHORITY=/home/USERNAME/.Xauthority sudo -E primusrun vmware

                               

                              don't forget to replace username.

                              • 87. Re: Workstation 9 - No 3D Acceleration to Guest - Ubuntu 12.04 Host - Nvidia Card
                                LinuxReCon Lurker

                                @rashm2k: Thanks for your answear, but it was much easier ... the reason why this whole thing didn't worked for me was just the fact, that I didn't replaced the version number which is included at the symbolic link command at the tutorial from cmillersp. So cmillersp posted to create the links with the following commands:

                                 

                                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/
                                but for myself I've got another version of the nvidia driver (304.64), so I had have to do the following commands:

                                 

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

                                sudo ln -s /usr/lib/nvidia-current/libnvidia-glcore.so.304.64 /usr/lib/x86_64-linux-gnu/
                                ... just logical
                                So, after every update of the nvidia driver you'll have to set the symbolic links again ... matching to your version of the installed nvidia driver
                                Overall, it's working now. I'm more interested in the 3D features, so I tried Torchlight 2 on a Windows 7 VM. Just amazing. Even on high details, I get 40 FPS at all. The only thing which a little bit annoys me is, that I have to start the VM with sudo / root rights. Is there no "workaround" for that?
                                • 88. Re: Workstation 9 - No 3D Acceleration to Guest - Ubuntu 12.04 Host - Nvidia Card
                                  LinuxReCon Lurker

                                  By the way, is it possible to find out that the nvidia card is used? Actually I just can say, that "it looks like" that it is gonna used, but a console output or something like that which ensures that would be awesome.

                                  • 89. Re: Workstation 9 - No 3D Acceleration to Guest - Ubuntu 12.04 Host - Nvidia Card
                                    goomba000 Novice

                                    LinuxReCon wrote:

                                     

                                    By the way, is it possible to find out that the nvidia card is used? Actually I just can say, that "it looks like" that it is gonna used, but a console output or something like that which ensures that would be awesome.

                                    See one of my previous posts.  Just look in vmware.log for OpenGL lines.

                                    1 4 5 6 7 8 Previous Next