Can't get Nvidia card working on my Optimus laptop

I would like to just use the Nvidia card on my laptop which has both intel and Nvidia. It has that extra horsepower and its just sitting while intel is taxing the system CPU and memory. I was able to get bumblebee enabled but when I tried to use it to run kwin it was very unstable. I couldn’t type into text boxes and eventually everything locked up. That is the one thing I want to run as I don’t do much gaming.

I think it would be fairly easy to set up but when I run xrandr --listproviders it only detects one card. I tried the xorg.conf setup NVidia says to use and I couldn’t start the x server. If anyone can help me out I would really appreciate it. I’ve spent hours and hours trying to figure this out.

Ok I don’t have optimus and would never ever buy hardware that used it.

But helping people here has shown that you need to follow the bumblebee instructions exactly and you must first be absolutely sure that you have removed any NVIDA driver you may have installed since bumblebee needs a special NVIDIA driver for bumblebee and may not work for any arbitrary NVIDIA driver or parts of.

So here are the instruction first remove all NVIDIA packages then follow instructions exactly

http://en.opensuse.org/SDB:NVIDIA_Bumblebee

first use yast2 / repositories to declare these:


# zypper lr -u | egrep -i -e '(Knurpht|Bumblebee)'
 1 | Bumblebee-nVidia-latest-12.3       | Bumblebee-nVidia-12.3-latest           | Yes     | Yes     | http://download.opensuse.org/repositories/home:/Bumblebee-Project:/nVidia:/latest/openSUSE_12.3/
10 | home:Knurpht:dkms-nvidia           | Knurpht:dkms-nvidia                    | No      | No      | http://download.opensuse.org/repositories/home:/Knurpht:/dkms-nvidia-bumblebee/openSUSE_12.3/   
11 | home:Knurpht:dkms-nvidia-bumblebee | Knurpht:dkms-nvidia-bumblebee          | Yes     | No      | http://download.opensuse.org/repositories/home:/Knurpht:/dkms-nvidia-bumblebee/openSUSE_12.3/   
13 | home_Bumblebee-Project_Bumblebee   | Bumblebee_Project_12.3                 | Yes     | No      | http://download.opensuse.org/repositories/home:/Bumblebee-Project:/Bumblebee/openSUSE_12.3/     

clean old nvidia traces


zypper rm  VirtualGL                         \
           VirtualGL-32bit                   \
           bumblebee                         \
           primus                            \
           primus-32bit                      \
           dkms-bbswitch                     \
           dkms-nvidia-bumblebee             \
           libturbojpeg                      \
           libturbojpeg-32bit                \
           dkms-nvidia                       \
           nvidia-compute                    \
           nvidia-compute-32bit              \
           nvidia-compute-devel              \
           nvidia-compute-devel-32bit        \
           x11-video-nvidia                  \
           x11-video-nvidia-32bit            \
           x11-video-nvidia-devel            \
           x11-video-nvidia-devel-32bit      \
           dkms-acpi_call


zypper in -f -r Bumblebee-nVidia-12.3-latest  dkms-nvidia                     \
                                              nvidia-compute                  \
                                              nvidia-compute-32bit            \
                                              nvidia-compute-devel            \
                                              nvidia-compute-devel-32bit      \
                                              x11-video-nvidia                \
                                              x11-video-nvidia-32bit          \
                                              x11-video-nvidia-devel          \
                                              x11-video-nvidia-devel-32bit


zypper in -f -r Knurpht:dkms-nvidia-bumblebee primus                \
                                              primus-32bit          \
                                              libturbojpeg          \
                                              libturbojpeg-32bit    

blacklist the nouveau driver by way of adding (or un-commenting) the line


blacklist nouveau

in /etc/modprobe.d/50-blacklist.conf

don’t forget to define the groups “video” and “bumblebee” - declare yourself a member to them

reboot / good luck

m

I had bumblebee working but I want to just use the NVidia card or use bublebee to run kwin. When I did optirun kwin --replace it was really unstable. I’m giving what you posted a try though. I changed the repos to 13.1. Did you intentionally mean to use an older version?

You could try this http://forums.opensuse.org/content.php/182-Bumblebee-Run-entire-KDE-session-on-NVIDIA
But keep an eye on temperature most Optimus laptops aren’t designed to run the nvidia card constantly, and don’t run it on battery.

Well I got optirun working the same as before. It seems to have no trouble hardware accelerating the windows but everything inside the windows has trouble redrawing. I can tell when I click stuff the computer thinks its changed but on the screen everything is locked up. This only works under optirun.

Under primusrun I get the error: Xlib: extension “GLX” missing on display “:0”.
Ill try to get the output for optirun.

If you at some point installed the nvidia driver by downloading the installer from the nvidia site it’s not enough to just uninstall it you must also reinstall the package xorg-x11-server.

I’ll try that. I did install the official driver because the one in the repo was not compiling and I wanted to see if I could get it working with Nvidia’s instructions.

I get this error when running bumblebee with kwin that I don’t get from running kwin by itself. It was hard to get this because I couldn’t see anything I was clicking.

rea: screens:  1 desktops:  4
kwin(16798) KWin::Workspace::updateClientArea: Done.
QCoreApplication::sendPostedEvents: Cannot send posted events for objects in another thread
QCoreApplication::sendPostedEvents: Cannot send posted events for objects in another thread
kwin(16798) KWin::Client::readUserTimeMapTimestamp: User timestamp, ASN: 4294967295
kwin(16798) KWin::Client::readUserTimeMapTimestamp: User timestamp, final: 'ID: 37749298 ;WMCLASS: "plasma" : "plasma" ;Caption: "plasma-desktop" ' : 4294967295
kwin(16798) KWin::Workspace::allowClientActivation: Activation: No client active, allowing
kwin(16798) KWin::Workspace::updateClientArea: screens:  1 desktops:  4
kwin(16798) KWin::Workspace::updateClientA

I forced a reinstall of that package and restarted X. When I try primusrun it still says I have no glx extension.

And you must also reinstall the package Mesa-libGL1, as this is also overwritten by the nvidia installer.
But actually the original files should be restored if you uninstall the driver AFAIK.

Well things might of course have changed, after all it’s now some years since I did the mistake myself but for me it was enough to reinstall xorg-x11-server and the uninstall command certainly didn’t restore what it had overwritten.

I’m not sure either.

Still, at least nowadays libGL gets overwritten as well, that was my main point… :wink:

I reinstalled everything with mesa in it’s name and xorg-x11-server. I started the bumblebee instillation steps from the beginning. I’m now getting a new error.

optirun --status
Bumblebee status: Error (3.2.1): [XORG] (EE) /dev/dri/card0: failed to set DRM interface version 1.4: Permission denied

Hm. Normally logind should give you permissions to access /dev/dri/card0.
But AFAIK this is only necessary for the kernel drivers, i.e. nouveau. nvidia doesn’t access /dev/dri/card0 I think.
So apparently there’s something wron with your nvidia driver installation, or did you not install it at all now?

Anyway, try to add your user to the “video” group, you should be able to access /dev/dri/card0 in any case then.

:~> ll /dev/dri/card0
 crw-rw----+ 1 root video 226, 0 14. Aug 10:17 /dev/dri/card0

But, if something is wrong in registering your user session with logind, you will have other problems as well, like not being able to install updates with the update applet or mounting removable media.

So, please post the output of “loginctrl” inside the graphical session, run as user.

I tried running it with Nouveau eventually because I was having such bad luck with Nvidia. I actually think the installer is failing when I try to install with Nvidia.


Output of dkms-nvidia-340.24-16.2.x86_64.rpm %posttrans script:
    patching file nv-linux.h
    Hunk #1 FAILED at 958.
    1 out of 1 hunk FAILED -- saving rejects to file nv-linux.h.rej
    ++ '' -x /usr/sbin/dkms ']'
    ++ /usr/sbin/dkms add -m nvidia -v 340.24-16.2 --rpm_safe_upgrade
    
    Creating symlink /var/lib/dkms/nvidia/340.24-16.2/source ->
                     /usr/src/nvidia-340.24-16.2
    
    DKMS: add completed.
    ++ /usr/sbin/dkms build -m nvidia -v 340.24-16.2
    
    Kernel preparation unnecessary for this kernel.  Skipping...
    
    Building module:
    cleaning build area....
    make KERNELRELEASE=3.16.0-rc7-2-desktop module KERNEL_UNAME=3.16.0-rc7-2-desktop.........
    cleaning build area....
    
    DKMS: build completed.
    ++ /usr/sbin/dkms install -m nvidia -v 340.24-16.2
    
    nvidia:
    Running module version sanity check.
     - Original module
       - No original module exists within this kernel
     - Installation
       - Installing to /lib/modules/3.16.0-rc7-2-desktop/updates/
    Adding any weak-modules
    depmod: ERROR: fstatat(4, nvidia-uvm.ko): No such file or directory
    Creating initrd: /boot/initrd-3.16.0-rc7-1-desktop
    Executing: /usr/bin/dracut --logfile /var/log/YaST2/mkinitrd.log --force --force-drivers "nvidia nvidia   nvidia nvidia nvidia nvidia nvidia nvidia nvidia" /boot/initrd-3.16.0-rc7-1-desktop 3.16.0-rc7-1-desktop
    *** Including module: bash ***
    *** Including module: warpclock ***
    *** Including module: i18n ***
    *** Including module: network ***
    dracut-install: ERROR: installing '/etc/sysconfig/network/ifroute-*'
    /usr/lib/dracut/dracut-install -D /var/tmp/initramfs.M41aad -a /etc/sysconfig/network/ifroute-*
    *** Including module: ifcfg ***
    *** Including module: drm ***
    *** Including module: plymouth ***
    *** Including module: kernel-modules ***
    Omitting driver i2o_scsi
    *** Including module: resume ***
    *** Including module: rootfs-block ***
    *** Including module: terminfo ***
    *** Including module: udev-rules ***
    Skipping udev rule: 91-permissions.rules
    Skipping udev rule: 80-drivers-modprobe.rules
    *** Including module: systemd ***
    *** Including module: usrmount ***
    *** Including module: base ***
    *** Including module: fs-lib ***
    *** Including module: shutdown ***
    *** Including module: suse ***
    *** Including modules done ***
    *** Installing kernel module dependencies and firmware ***
    *** Installing kernel module dependencies and firmware done ***
    *** Resolving executable dependencies ***
    *** Resolving executable dependencies done***
    *** Hardlinking files ***
    *** Hardlinking files done ***
    *** Stripping files ***
    *** Stripping files done ***
    *** Generating early-microcode cpio image ***
    *** Constructing GenuineIntel.bin ****
    *** Store current command line parameters ***
    Stored kernel commandline:
    rd.driver.pre=nvidia
    rd.driver.pre=nvidia
    rd.driver.pre=nvidia
    rd.driver.pre=nvidia
    rd.driver.pre=nvidia
    rd.driver.pre=nvidia
    rd.driver.pre=nvidia
    rd.driver.pre=nvidia
    rd.driver.pre=nvidia
     resume=UUID=0b6abb33-9487-439d-929e-77a29b3f0bbd
    root=UUID=d2bad3a8-dad5-4b6f-93ce-ef4cd755e7f3 rootflags=rw,noatime,data=ordered rootfstype=ext4
    *** Creating image file ***
    *** Creating image file done ***
    Update bootloader...
    
    depmod....
    
    Backing up initrd-3.16.0-rc7-2-desktop to /boot/initrd-3.16.0-rc7-2-desktop.old-dkms
    Making new initrd-3.16.0-rc7-2-desktop
    (If next boot fails, revert to initrd-3.16.0-rc7-2-desktop.old-dkms image)
    dracut....(bad exit status: 1)
    
    -------- Uninstall Beginning --------
    Module:  nvidia
    Version: 340.24-16.2
    Kernel:  3.16.0-rc7-2-desktop (x86_64)
    -------------------------------------
    
    Status: Before uninstall, this module version was ACTIVE on this kernel.
    Removing any linked weak-modules
    
    nvidia.ko:
     - Uninstallation
       - Deleting from: /lib/modules/3.16.0-rc7-2-desktop/updates/
     - Original module
       - No original module was found for this module on this kernel.
       - Use the dkms install command to reinstall any previous module version.
    
    depmod....
    
    Backing up initrd-3.16.0-rc7-2-desktop to /boot/initrd-3.16.0-rc7-2-desktop.old-dkms
    Making new initrd-3.16.0-rc7-2-desktop
    (If next boot fails, revert to initrd-3.16.0-rc7-2-desktop.old-dkms image)
    dracut....(bad exit status: 1)
    : There was a problem remaking your initrd.  You must manually remake it
    before booting into this kernel.
    
    DKMS: uninstall completed.
    Error! Problems with mkinitrd detected.  Automatically uninstalling this module.
    DKMS: Install Failed (mkinitrd problems).  Module rolled back to built state.
    ++ popd

Output of x11-video-nvidia-32bit-340.24-18.1.x86_64.rpm %posttrans script:
    /usr/lib/nvidia /usr/src /
    /usr/src /


I looked around the log files and I can’t find any way to fix this. I also don’t have the command loginctrl and when I run cnf it brings up nothing. I’m going to reboot and see if anything changes.

Would you be interested in taking a look over Team viewer? I’d really appreceate it.

Heres some more info:

With Nvidia set as the driver bumblebee fails to start:


/usr/sbin/bumblebeed   -vv                                                                                                                                                                491.895825] [DEBUG]Found card: 01:00.0 (discrete)
  491.895853] [DEBUG]Found card: 00:02.0 (integrated)
  491.895860] [DEBUG]Reading file: /etc/bumblebee/bumblebee.conf
  491.896265] [INFO]Configured driver: nvidia
  491.896280] [DEBUG]Skipping auto-detection, using configured driver 'nvidia'
  491.896435] [DEBUG]Process /sbin/modprobe started, PID 12479.
  491.896524] [DEBUG]Hiding stderr for execution of /sbin/modprobe
  491.898905] [DEBUG]SIGCHILD received, but wait failed with No child processes
  491.898999] [DEBUG]bbswitch has been detected.
  491.899027] [INFO]Switching method 'bbswitch' is available and will be used.
  491.899037] [DEBUG]Active configuration:
  491.899044] [DEBUG] bumblebeed config file: /etc/bumblebee/bumblebee.conf
  491.899060] [DEBUG] X display: :8
  491.899067] [DEBUG] LD_LIBRARY_PATH: /usr/lib64/nvidia:/usr/lib/nvidia
  491.899071] [DEBUG] Socket path: /var/run/bumblebee.socket
  491.899075] [DEBUG] xorg.conf file: /etc/bumblebee/xorg.conf.nvidia
  491.899091] [DEBUG] xorg.conf.d dir: /etc/bumblebee/xorg.conf.d
  491.899095] [DEBUG] ModulePath: /usr/lib64/nvidia/xorg/,/usr/lib64/xorg/modules
  491.899100] [DEBUG] GID name: bumblebee
  491.899104] [DEBUG] Power method: auto
  491.899108] [DEBUG] Stop X on exit: 1
  491.899112] [DEBUG] Driver: nvidia
  491.899116] [DEBUG] Driver module: nvidia
  491.899120] [DEBUG] Card shutdown state: 1
  491.899261] [DEBUG]Process /sbin/modprobe started, PID 12480.
  491.899348] [DEBUG]Hiding stderr for execution of /sbin/modprobe
  491.901432] [DEBUG]SIGCHILD received, but wait failed with No child processes
  491.901463] [ERROR]Module 'nvidia' is not found.

optirun status
  627.108973] [ERROR]The Bumblebee daemon has not been started yet or the socket path /var/run/bumblebee.socket was incorrect.
  627.109043] [ERROR]Could not connect to bumblebee daemon - is it running?

With nouveau set as the driver:


optirun status
   611.975412] [ERROR]Cannot access secondary GPU - error: [XORG] (EE)  /dev/dri/card0: failed to set DRM interface version 1.4: Permission  denied

  611.975482] [ERROR]Aborting because fallback start is disabled.


Well, that message is clear.
Something went wrong with the nvidia driver installation.

The patch is failing. Not sure if this is a problem though. (normally something like that means that the patch is for a different version)
I would try to completely remove dkms-nvidia and then install it again.
Some things are not done if you just reinstall it.
And try to remove everything starting with nvidia in /usr/src before you install it again.

sudo rm -r /usr/src/nvidia*

So you are using Factory? (because of kernel 3.16rc7 and dracut)
Btw, the current kernel is 3.16.0.

I also don’t have the command loginctrl and when I run cnf it brings up nothing. I’m going to reboot and see if anything changes.

It is called “loginctl”.

Would you be interested in taking a look over Team viewer? I’d really appreceate it.

Not really, sorry.
I never used Team viewer and don’t have it installed.
I’m not even sure I could help you. I never used Bumblebee myself.

PS: If you added those home:Knurpht repos that were mentioned earlier in this thread, please remove them again!
And remove all packages you installed from there, I saw x11-video-nvidia mentioned in one of your outputs.
They are outdated and unmaintained. And installing different packages of the nvidia driver at the same time only causes problems.

X11:Bumblebee should contain all you need.

And as I see now, the package is called “nvidia-bumblebee” there, not “dkms-nvidia”, sorry.
You should uninstall “dkms-nvidia” as well if you have that installed.

Only install “nvidia-bumblebee” from X11:Bumblebee and the other packages mentioned here:
http://en.opensuse.org/SDB:NVIDIA_BumblebeeRemove all other bumblebee/nvidia packages from other repos.

Somewhere along the line I actually did a full reinstall of the OS. Its working now with various problems. The testing app glxspheres runs fine. Performance is pretty bad in the one game I tried. Simply running glxspheres the framerate doubles. But running stunt rally had really bad performance. I still have the same bug when I try to run kwin with it.

You do understand that under bumblebee you have to use


optirun program-name

to start any process that you want to run with the NVIDIA chip. Otherwise you are still using the Intel chip