Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bumblebee with VirtualBox #278

Closed
thecandyman opened this issue Nov 5, 2012 · 51 comments

Comments

@thecandyman
Copy link

commented Nov 5, 2012

Hi all!

I have a Xub12.04 box, with Nvidia / Intel Graphics.
I installed Bumblebee following Ubuntu Wiki (https://wiki.ubuntu.com/Bumblebee).
Everything seems to work tried also a game (Neverputt).
While playing Neverputt I checked temperature with nvidia-settings and it was increasing (just a dummy test to check if it was really using nvidia card).

I tried to run Virtualbox (winXP) with optirun.

$ optirun VirtualBox -startvm Winzozz
ERROR: ld.so: object 'libdlfaker.so' from LD_PRELOAD cannot be preloaded: ignored.
ERROR: ld.so: object 'librrfaker.so' from LD_PRELOAD cannot be preloaded: ignored.

The VM starts but NVIDIA temperature doesn't seem to increase, so I suspect that optirun does not work as I wish and those errors must be investigated.
So I googled around these errors and I found a guide (http://www.virtualgl.org/vgldoc/2_1/#hd0012) which I followed (simply changed with chmod some .so files).

Now when I try to start VM, it stops in a second:

$ optirun VirtualBox -startvm Winzozz
libGL error: failed to load driver: swrast
libGL error: Try again with LIBGL_DEBUG=verbose for more details.

Tryied to use LIBGL_DEBUG flag, then I get

LIBGL_DEBUG=verbose optirun VirtualBox -startvm Winzozz
libGL: screen 0 does not appear to be DRI2 capable
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
libGL error: failed to load driver: swrast

The result is that I can run VirtualBox without using optirun, but it crashes with these errors.
Any idea?

@amonakov

This comment has been minimized.

Copy link
Contributor

commented Nov 5, 2012

Is there a libGL.so.1 symlink in /usr/lib/nvidia-current and /usr/lib32/nvidia-current? What is the version of your nVidia drivers?

@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 5, 2012

 /usr/lib/nvidia-current $ ls -la libGL*
lrwxrwxrwx 1 root root      10 Oct 19 06:02 libGL.so -> libGL.so.1
lrwxrwxrwx 1 root root      15 Oct 19 06:02 libGL.so.1 -> libGL.so.304.60
-rw-r--r-- 1 root root 1076560 Oct 19 06:03 libGL.so.304.60
/usr/lib32/nvidia-current $ ls -la libGL*
-rw-r--r-- 1 root root    652 Oct 15 06:20 libGL.la
lrwxrwxrwx 1 root root     10 Oct 19 06:02 libGL.so -> libGL.so.1
lrwxrwxrwx 1 root root     15 Oct 19 06:02 libGL.so.1 -> libGL.so.304.60
-rw-r--r-- 1 root root 833060 Oct 19 06:03 libGL.so.304.60

Don't know how to obtain nvidia drivers version :(

@amonakov

This comment has been minimized.

Copy link
Contributor

commented Nov 5, 2012

Looks good, and your driver version is 304.60. Does it work if you launch it like this?

VGL_GLLIB=/usr/lib/nvidia-current/libGL.so.1 optirun VirtualBox -startvm Winzozz
@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 5, 2012

No way :( I get the following:

$ VGL_GLLIB=/usr/lib/nvidia-current/libGL.so.1 optirun VirtualBox -startvm Winzozz
[VGL] ERROR: Could not open /usr/lib/nvidia-current/libGL.so.1
[VGL]    libnvidia-tls.so.304.60: cannot open shared object file: No such file or directory
@amonakov

This comment has been minimized.

Copy link
Contributor

commented Nov 5, 2012

Hm, VirtualBox script seems to overwrite LD_LIBRARY_PATH. Can you pastebin contents of file given by which VirtualBox?

@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 5, 2012

$ cat `which VirtualBox`
#!/bin/sh
#
# written by Patrick Winnertz <patrick.winnertz@skolelinux.org> and
# Michael Meskes <meskes@debian.org>
# and placed under GPLv2
#
# this is based on a script by
# InnoTek VirtualBox
#
# Copyright (C) 2006 InnoTek Systemberatung GmbH
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# you can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation,
# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
# distribution. VirtualBox OSE is distributed in the hope that it will
# be useful, but WITHOUT ANY WARRANTY of any kind.

PATH="/usr/bin:/bin:/usr/sbin:/sbin"

# VirtualBox installation directory
INSTALL_DIR="/usr/lib/virtualbox"

# We don't distribute this file anymore. However, if it is still there we use
# it, just to be sure we stay compatible with older versions.
[ -f /etc/vbox/vbox.cfg ] && . /etc/vbox/vbox.cfg

if [ "$VBOX_USER_HOME" = "" ]; then
    if [ ! -d "$HOME/.VirtualBox" ]; then
        mkdir -p "$HOME/.VirtualBox"
    fi
    LOG="$HOME/.VirtualBox/VBoxSVC.log"
else
    if [ ! -d "$VBOX_USER_HOME" ]; then
        mkdir -p "$VBOX_USER_HOME"
    fi
    LOG="$VBOX_USER_HOME/VBoxSVC.log"
fi

# Note: This script must not fail if the module was not successfully installed
#       because the user might not want to run a VM but only change VM params!

if [ ! -c /dev/vboxdrv ]; then
    cat << EOF
WARNING: The character device /dev/vboxdrv does not exist.
     Please install the virtualbox-ose-dkms package and the appropriate
     headers, most likely linux-headers-$(uname -r | cut -d- -f3).

     You will not be able to start VMs until this problem is fixed.
EOF
fi

APP=`which $0`
APP=${APP##/*/}
case "$APP" in
  VirtualBox|virtualbox)
    exec "$INSTALL_DIR/VirtualBox" "$@"
  ;;
  VBoxHeadless|vboxheadless)
    exec "$INSTALL_DIR/VBoxHeadless" "$@"
  ;;
  VBoxManage|vboxmanage)
    exec "$INSTALL_DIR/VBoxManage" "$@"
  ;;
  VBoxSDL|vboxsdl)
    exec "$INSTALL_DIR/VBoxSDL" "$@"
  ;;
  vditool)
    exec "$INSTALL_DIR/vditool" "$@"
  ;;
  vboxwebsrv)
    exec "$INSTALL_DIR/vboxwebsrv" "$@"
  ;;
  *)
    echo "Unknown application - $APP"
  ;;
esac
@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 5, 2012

Addition: LD_LIBRARY_PATH is not set, I get empty when I give

printenv LD_LIBRARY_PATH
@amonakov

This comment has been minimized.

Copy link
Contributor

commented Nov 5, 2012

LD_LIBRARY_PATH is set by optirun. Pastebin /usr/lib/virtualbox/VirtualBox

@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 5, 2012

I think /usr/lib/virtualbox/VirtualBox is binary... I get strange character when I do

cat /usr/lib/virtualbox/VirtualBox
@amonakov

This comment has been minimized.

Copy link
Contributor

commented Nov 5, 2012

Ah, of course, LD_LIBRARY_PATH is ignored for set-uid binaries.

You can workaround it with

sudo ldconfig -l /usr/lib/nvidia-current/libnvidia-tls.so.304.60

You may need to repeat variation of the above command for other libraries that VGL_GLLIB=/usr/lib/nvidia-current/libGL.so.1 optirun VirtualBox -startvm Winzozz will fail to load.

@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 5, 2012

ok, thanks. I tried, I get this:

$ sudo ldconfig -l /usr/lib/nvidia-current/libnvidia-tls.so.304.60
$ VGL_GLLIB=/usr/lib/nvidia-current/libGL.so.1 optirun VirtualBox -startvm Winzozz
[VGL] ERROR: Could not open /usr/lib/nvidia-current/libGL.so.1
[VGL]    libnvidia-tls.so.304.60: cannot open shared object file: No such file or directory

It seems it complains about libnvidia-tls.so.304.60 only.
Of course, the file exists since I get the following:

$ ls -la /usr/lib/nvidia-current/libnvidia-tls.so.304.60
-rw-r--r-- 1 root root 11704 Oct 19 06:03 /usr/lib/nvidia-current/libnvidia-tls.so.304.60
@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 5, 2012

My fault, I missed /usr/lib/nvidia-current/libGL.so.1 from the error

[VGL] ERROR: Could not open /usr/lib/nvidia-current/libGL.so.1

Should I ldconfig even this file?

@amonakov

This comment has been minimized.

Copy link
Contributor

commented Nov 5, 2012

No, do not add nvidia libGL.so.1 to ldconfig. Try ldconfig -p |grep nvidia-tls. If it's not empty, upload to a pastebin site /tmp/ld-debug.txt from

LD_DEBUG=libs VGL_GLLIB=/usr/lib/nvidia-current/libGL.so.1 optirun VirtualBox -startvm Winzozz |& tee /tmp/ld-debug.txt

but do not paste it here, the file is very long.

@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 5, 2012

It is empty. Anyway this is the log: http://pastebin.com/m9XazxWS

@amonakov

This comment has been minimized.

Copy link
Contributor

commented Nov 5, 2012

Sigh, ldconfig -l does not add libraries to the cache. Well, you can either try to preload all needed libraries (you can add more libraries to LD_PRELOAD by separating them with a colon):

LD_PRELOAD=/usr/lib/nvidia-current/libnvidia-tls.so.304.60 VGL_GLLIB=/usr/lib/nvidia-current/libGL.so.1 optirun VirtualBox -startvm Winzozz

or you can add symlinks to the libraries in search path:

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

Other distributions (perhaps except Gentoo) do not have this issue because they install libnvidia-tls and friends to /usr/lib

@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 5, 2012

I really thank you for your patience.
Using

LD_PRELOAD=/usr/lib/nvidia-current/libnvidia-tls.so.304.60 VGL_GLLIB=/usr/lib/nvidia-current/libGL.so.1 optirun VirtualBox -startvm Winzozz

doesn't cause any error but Virtual Machine is not loaded. Despite the first attempts, where there are a black screen for a while, in this case nothing happens on video...

@amonakov

This comment has been minimized.

Copy link
Contributor

commented Nov 5, 2012

Then try the other way

@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 5, 2012

I gave this:

$ sudo ln -s /usr/lib/nvidia-current/libnvidia-tls.so.304.60 /usr/lib/x86_64-linux-gnu/
[sudo] password for user: 
$ LIBGL_DEBUG=verbose LD_PRELOAD=/usr/lib/nvidia-current/libnvidia-tls.so.304.60 VGL_GLLIB=/usr/lib/nvidia-current/libGL.so.1 optirun VirtualBox -startvm Winzozz

Same behavior, no error, no video response.

@amonakov

This comment has been minimized.

Copy link
Contributor

commented Nov 5, 2012

No, remove LD_PRELOAD=... if you're going the symlink way. And while you're at it, change LIBGL_DEBUG=verbose to VGL_VERBOSE=1.

@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 5, 2012

Here it is!

$ VGL_VERBOSE=1 VGL_GLLIB=/usr/lib/nvidia-current/libGL.so.1 optirun VirtualBox -startvm Winzozz
[VGL] NOTICE: Replacing dlopen("/lib/x86_64-linux-gnu/libdl.so.2") with dlopen("libdlfaker.so")
[VGL] NOTICE: Replacing dlopen("/lib/x86_64-linux-gnu/libdl.so.2") with dlopen("libdlfaker.so")
[VGL] Shared memory segment ID for vglconfig: 13467656
[VGL] VirtualGL v2.3.2 64-bit (Build 20121005)
[VGL] ERROR: Could not open /usr/lib/nvidia-current/libGL.so.1
[VGL]    libnvidia-glcore.so.304.60: cannot open shared object file: No such file or directory

Again, VirtualBox doesn't run

@amonakov

This comment has been minimized.

Copy link
Contributor

commented Nov 5, 2012

Well, now repeat symlinking for libnvidia-glcore.so.304.60, and so on (except libGL.so.1)

@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 5, 2012

Nothing again:

$ sudo ln -s /usr/lib/nvidia-current/libnvidia-glcore.so.304.60 /usr/lib/x86_64-linux-gnu/
$ VGL_VERBOSE=1 VGL_GLLIB=/usr/lib/nvidia-current/libGL.so.1 optirun VirtualBox -startvm Winzozz
[VGL] NOTICE: Replacing dlopen("/lib/x86_64-linux-gnu/libdl.so.2") with dlopen("libdlfaker.so")
[VGL] NOTICE: Replacing dlopen("/lib/x86_64-linux-gnu/libdl.so.2") with dlopen("libdlfaker.so")
[VGL] Shared memory segment ID for vglconfig: 14221324
[VGL] VirtualGL v2.3.2 64-bit (Build 20121005)
@amonakov

This comment has been minimized.

Copy link
Contributor

commented Nov 5, 2012

Well, that's unfortunate, but I'm afraid I can't help you further than this. VirtualGL is known to work with VirtualBox for some people, I helped you fix what obviously needed fixing.

@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 5, 2012

Ok, thank you. Can I do some other things? Like reinstallation or similar

@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 6, 2012

I post the log of VirtualBox when run with the command

VGL_VERBOSE=1 VGL_GLLIB=/usr/lib/nvidia-current/libGL.so.1 optirun VirtualBox --startvm Winzozz

hoping this could give some other information on the problem:

VirtualBox 4.1.12_Ubuntu r77245 linux.amd64 (Jun 14 2012 20:07:18) release log
00:00:02.286 Log opened 2012-11-06T07:55:34.344780000Z
00:00:02.286 OS Product: Linux
00:00:02.286 OS Release: 3.2.0-32-generic
00:00:02.286 OS Version: #51-Ubuntu SMP Wed Sep 26 21:33:09 UTC 2012
00:00:02.286 DMI Product Name: N56VM
00:00:02.286 DMI Product Version: 1.0       
00:00:02.287 Host RAM: 7878MB RAM, available: 7266MB
00:00:02.287 Executable: /usr/lib/virtualbox/VirtualBox
00:00:02.287 Process ID: 2678
00:00:02.287 Package type: LINUX_64BITS_GENERIC (OSE)
00:00:02.337 Installed Extension Packs:
00:00:02.337   None installed!
00:00:02.398 SUP: Loaded VMMR0.r0 (/usr/lib/virtualbox/VMMR0.r0) at 0xffffffffa04da080 - ModuleInit at ffffffffa04ef8c0 and ModuleTerm at ffffffffa04ef950
00:00:02.398 SUP: VMMR0EntryEx located at ffffffffa04f0b40, VMMR0EntryFast at ffffffffa04f08c0 and VMMR0EntryInt at ffffffffa04f08b0
00:00:02.426 File system of '/home/dario/VirtualBox VMs/Winzozz/Snapshots' (snapshots) is unknown
00:00:02.426 File system of '/home/dario/VirtualBox VMs/Winzozz/Winzozz_disk.vdi' is ext4
00:00:02.460 VBoxSharedClipboard mode: Bidirectional
00:00:02.461 Using XKB for keycode to scan code conversion
00:00:03.110 OpenGL Warning: Render SPU: Display :0.0 doesn't have the necessary visual: RGB, Doublebuffer, Z
00:00:03.110 OpenGL Warning: Render SPU: Couldn't get a visual, renderspu_SystemInitVisual failed
00:00:03.110 OpenGL Warning: Render SPU: Couldn't create a window, renderspuFindVisual returned NULL
00:00:03.110 OpenGL Error: Render SPU: Couldn't get a double-buffered, RGB visual with Z!
00:00:03.110 Failed to load Shared OpenGL service VERR_NOT_SUPPORTED
@amonakov

This comment has been minimized.

Copy link
Contributor

commented Nov 6, 2012

Your version of VirtualBox is quite old, can you try a newer version?

@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 6, 2012

Is VBox 4.2 a good choice? I'm going to download it...

@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 6, 2012

Removed old VBox and installed VBox4.2. Get similar errors:

$ VGL_VERBOSE=1  VGL_GLLIB=/usr/lib/nvidia-current/libGL.so.1 optirun VirtualBox -startvm Winzozz
[VGL] NOTICE: Replacing dlopen("/lib/x86_64-linux-gnu/libdl.so.2") with dlopen("libdlfaker.so")
[VGL] NOTICE: Replacing dlopen("/lib/x86_64-linux-gnu/libdl.so.2") with dlopen("libdlfaker.so")
[VGL] NOTICE: Replacing dlopen("/lib/x86_64-linux-gnu/libdl.so.2") with dlopen("libdlfaker.so")
[VGL] NOTICE: Replacing dlopen("/lib/x86_64-linux-gnu/libdl.so.2") with dlopen("libdlfaker.so")
[VGL] NOTICE: Replacing dlopen("/lib/x86_64-linux-gnu/libdl.so.2") with dlopen("libdlfaker.so")
[VGL] NOTICE: Replacing dlopen("/lib/x86_64-linux-gnu/libdl.so.2") with dlopen("libdlfaker.so")
[VGL] Shared memory segment ID for vglconfig: 1245194
[VGL] VirtualGL v2.3.2 64-bit (Build 20121005)
[VGL] ERROR: Could not open /usr/lib/nvidia-current/libGL.so.1
[VGL]    libnvidia-tls.so.304.60: cannot open shared object file: No such file or directory

Here is the virtualbox log:

VirtualBox VM 4.2.4 r81684 linux.amd64 (Oct 26 2012 18:44:53) release log
00:00:00.296789 Log opened 2012-11-06T16:02:48.170041000Z
00:00:00.296792 OS Product: Linux
00:00:00.296792 OS Release: 3.2.0-32-generic
00:00:00.296793 OS Version: #51-Ubuntu SMP Wed Sep 26 21:33:09 UTC 2012
00:00:00.296806 DMI Product Name: N56VM
00:00:00.296811 DMI Product Version: 1.0       
00:00:00.296817 Host RAM: 7878MB total, 5619MB available
00:00:00.296819 Executable: /usr/lib/virtualbox/VBoxHeadless
00:00:00.296819 Process ID: 5797
00:00:00.296820 Package type: LINUX_64BITS_UBUNTU_12_04
00:00:00.345115 Installed Extension Packs:
00:00:00.345147   None installed!
00:00:00.347598 VRDE: VirtualBox Remote Desktop Extension is not available.
00:00:00.352125 SUP: Loaded VMMR0.r0 (/usr/lib/virtualbox/VMMR0.r0) at 0xffffffffa0fad020 - ModuleInit at ffffffffa0fc34e0 and ModuleTerm at ffffffffa0fc3770
00:00:00.352150 SUP: VMMR0EntryEx located at ffffffffa0fc4900, VMMR0EntryFast at ffffffffa0fc4640 and VMMR0EntryInt at ffffffffa0fc4630
00:00:00.367451 File system of '/home/dario/VirtualBox VMs/Winzozz/Snapshots' (snapshots) is unknown
00:00:00.367470 File system of '/home/dario/VirtualBox VMs/Winzozz/Winzozz_disk.vdi' is ext4
00:00:00.384671 Shared clipboard mode: Bidirectional
00:00:00.386599 Drag'n'drop mode: Off
00:00:00.387003 VBOX_CROGL_FORCE_SUPPORTED is specified, skipping 3D test, and treating as supported
@amonakov

This comment has been minimized.

Copy link
Contributor

commented Nov 6, 2012

[VGL] libnvidia-tls.so.304.60: cannot open shared object file: No such file or directory

I have walked you through working around this issue yesterday. Have you removed the symlinks?

@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 6, 2012

Nope, since I get this:

$ sudo ln -s /usr/lib/nvidia-current/libnvidia-glcore.so.304.60 /usr/lib/x86_64-linux-gnu/
ln: failed to create symbolic link `/usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.304.60': File exists
@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 6, 2012

Finally some good news!!!
I re-created the virtual machine by using sudo virtualbox.
Then I run the machine as follows:

sudo optirun VirtualBox --startvm Winzozz2

No error, machine loaded succesfully, nvidia-settings says that dedicated ram is used!!!
So I can say that the problem is solved!!!
But I have a final question... Since everything goes well with sudo, I think the problem is about permission or groups.
Most probably I don't belong to certain groups, so I got all those errors.
Which are the groups I should belong to say that my bumblebee/optirun is well configured?

@amonakov

This comment has been minimized.

Copy link
Contributor

commented Nov 6, 2012

You really should pay attention to what you're reading.

You have read that LD_PRELOAD is ignored for set-uid executables, and I mentioned the same applies for LD_LIBRARY_PATH. When you're launching the VM with sudo optirun, you're effectively granting root permissions to optirun, and when it invokes VirtualBox later on, those restrictions do not apply, because the invoking user effectively has root privileges.

Note that sudo optirun is not a good solution, I would prefer if a real fix is found. But if you're fine this way, please close the bug.

@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 6, 2012

Sorry if I misunderstood something.

I know that in general sudo should be used only in some particular situation, not for everyday task. So I agree with you, it is not a good solution.

In general sudo is used when one does not have permission to execute some task and sometimes, some of these task can be performed by normal user simply by adding the user to certain groups.

So, I was wondering if the "fix" we are looking for could be reachable by working on group membership.

That's my memberships:

$ groups thecandyman
thecandyman : thecandyman adm lp cdrom sudo dip plugdev users lpadmin sambashare vboxusers bumblebee
@amonakov

This comment has been minimized.

Copy link
Contributor

commented Nov 6, 2012

No, the last problem was that libnvidia-tls.so could not be loaded, even though you added a symlink to a system library path. You can again try

LD_DEBUG=libs VGL_GLLIB=/usr/lib/nvidia-current/libGL.so.1 optirun VirtualBox -startvm Winzozz |& tee /tmp/ld-debug.txt
@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 6, 2012

Here it is:

[extremely long log removed -- amonakov]

@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 6, 2012

sorry, it is too long so site cutted it. Here is the pastebin http://pastebin.com/SSsSt4ze

@amonakov

This comment has been minimized.

Copy link
Contributor

commented Nov 6, 2012

Dammit, LD_DEBUG is ignored for setuid binaries as well. Can you copy libnvidia-tls.so.304.60 and libnvidia-glcore.so.304.60 from /usr/lib/nvidia-current to /usr/lib/x86_64-linux-gnu, then run sudo ldconfig and

VGL_GLLIB=/usr/lib/nvidia-current/libGL.so.1 optirun VirtualBox -startvm Winzozz 

PS. Like the previous time, you should have pasted ld-debug output to an external pastebin. Do I really have to spell out instructions in full each time? Are you testing my patience?

@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 6, 2012

Sorry, I just get out from work and I'm really tired. I really appreciate your patience!!!
I did what you asked:

$ sudo cp /usr/lib/nvidia-current/libnvidia-tls.so.304.60 /usr/lib/x86_64-linux-gnu/
$ sudo cp /usr/lib/nvidia-current/libnvidia-glcore.so.304.60 /usr/lib/x86_64-linux-gnu/
cp: `/usr/lib/nvidia-current/libnvidia-glcore.so.304.60' and `/usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.304.60' are the same file
$ sudo ldconfig
$ VGL_GLLIB=/usr/lib/nvidia-current/libGL.so.1 optirun VirtualBox -startvm Winzozz 

It does nothing!

It's strange the second line...

cp: `/usr/lib/nvidia-current/libnvidia-glcore.so.304.60' and `/usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.304.60' are the same file

never faced with something similar before!

@amonakov

This comment has been minimized.

Copy link
Contributor

commented Nov 6, 2012

Well sure -- remove the symlinks you placed there earlier first.

@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 6, 2012

$ sudo rm /usr/lib/x86_64-linux-gnu/libnvidia-*
$ sudo cp /usr/lib/nvidia-current/libnvidia-tls.so.304.60 /usr/lib/x86_64-linux-gnu/
$ sudo cp /usr/lib/nvidia-current/libnvidia-glcore.so.304.60 /usr/lib/x86_64-linux-gnu/
$ sudo ldconfig
$ VGL_GLLIB=/usr/lib/nvidia-current/libGL.so.1 optirun VirtualBox -startvm Winzozz 

nothing again

@amonakov

This comment has been minimized.

Copy link
Contributor

commented Nov 6, 2012

What do you mean by "nothing"? Does VirtualBox output anything at all?

@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 6, 2012

Nothing... No other output on terminal than what I listed here, no video response (in some previous cases there was a black screen for a nanosecond).

@amonakov

This comment has been minimized.

Copy link
Contributor

commented Nov 6, 2012

Hm, try to copy libnvidia-tls.so.304.60 from /usr/lib/nvidia-current/tls instead, then run sudo ldconfig and launch the VM.

@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 6, 2012

Some progress now!!! :)
Machine starts, Winzozz XP boot, but during boot it crashes.
Here is what terminal says:

$ VGL_VERBOSE=1 VGL_GLLIB=/usr/lib/nvidia-current/libGL.so.1 optirun virtualbox --startvm Winzozz 
[VGL] NOTICE: Replacing dlopen("/lib/x86_64-linux-gnu/libdl.so.2") with dlopen("libdlfaker.so")
[VGL] NOTICE: Replacing dlopen("/lib/x86_64-linux-gnu/libdl.so.2") with dlopen("libdlfaker.so")
[VGL] NOTICE: Replacing dlopen("/lib/x86_64-linux-gnu/libdl.so.2") with dlopen("libdlfaker.so")
[VGL] NOTICE: Replacing dlopen("/lib/x86_64-linux-gnu/libdl.so.2") with dlopen("libdlfaker.so")
[VGL] NOTICE: Replacing dlopen("/lib/x86_64-linux-gnu/libdl.so.2") with dlopen("libdlfaker.so")
[VGL] NOTICE: Replacing dlopen("/lib/x86_64-linux-gnu/libdl.so.2") with dlopen("libdlfaker.so")
[VGL] Shared memory segment ID for vglconfig: 3833873
[VGL] VirtualGL v2.3.2 64-bit (Build 20121005)
[VGL] Opening local display :8
Error opening file for reading: Permission denied
[VGL] NOTICE: dlopen("VBoxOGLhosterrorspu.so") failed.
[VGL]    Trying dlopen("/usr/lib/virtualbox/VBoxOGLhosterrorspu.so")
[VGL] NOTICE: Replacing dlopen("libGL.so.1") with dlopen("librrfaker.so")
[VGL] ERROR: in readpixels--
[VGL]    256: GL_ARB_pixel_buffer_object extension not available
@amonakov

This comment has been minimized.

Copy link
Contributor

commented Nov 6, 2012

That's easy, use a newer version of VirtualGL. Or add VGL_READBACK=sync in front of the command (but you'll lose some performance).

@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 6, 2012

Wonderful! Finally it runs (using VGL_READBACK=sync).
How can I get newer version of VirtualGL?

@amonakov

This comment has been minimized.

Copy link
Contributor

commented Nov 6, 2012

Hm, you're already using the latest release. I'm not sure, perhaps it will be fixed in the next release then.

By the way, I'm the author of another OpenGL offloading solution called primus. As a "thank you", could you try installing it (from this PPA: https://launchpad.net/~zhurikhin/+archive/primus) and try to run the VM via primus instead:

sudo primusrun virtualbox --startvm Winzozz 

(note -- you'll need sudo for primus, unfortunately). I just wonder if it will work.

@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 6, 2012

Do I have to remove bumblebee first or I can install it without removing it?

@amonakov

This comment has been minimized.

Copy link
Contributor

commented Nov 6, 2012

Do not remove anything.

@thecandyman

This comment has been minimized.

Copy link
Author

commented Nov 6, 2012

Well, it started!!! I only have to say THANK YOU and an heartly COMPLIMENTI!!! (I'm italian and I don't know how to translate this...this mean something like "great work!").
I really understand how worthwhile is your job since I'm a PhD student in Informatic Engineering (Automation branch), so again thank you and compilmenti!!! :D

I'll keep trying primus and if appreciated I will post some observation/bug if I have/found one!

@amonakov

This comment has been minimized.

Copy link
Contributor

commented Nov 6, 2012

Oh, wow, I totally didn't expect that primus would work. That's great news -- and thank you for working with me till the end. We spent a lot of time, but now I understand what was required to make VirtualGL+Bumblebee work with set-uid executables without sudo. I'm taking the liberty to close this issue -- feel free to reopen or file a new report for other problems.

You can submit primus bugreports here: https://github.com/amonakov/primus/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.