How to make Nvidia Optimus on OpenSUSE 13.2 (See details inside)

“/var/lib/dkms/nvidia/343.22/build” is there, "/var/tmp/dkms/"doesn’t seem to be though.

As for uninstalling it before reinstalling it, that’s what I’m doing. Is it possible that something remains somewhere?

Hm. Try to reinstall dkms maybe before you reinstall nvidia-bumblebee?

As for uninstalling it before reinstalling it, that’s what I’m doing. Is it possible that something remains somewhere?

No idea, I’ve never installed it myself (don’t have an Optimus system). And I haven’t used dkms myself either yet.
But there shouldn’t, I’d say.

And I haven’t ever seen that error message either.
But googling showed me that you yourself had the same problem already last year though:
https://forums.opensuse.org/showthread.php/484188-Setup-bumblebee-and-primus-in-openSUSE-12-3?p=2603030#post2603030
And reinstalling dkms seemed to have fixed it back then… :wink:

Remembering that I did try to reinstall dkms, but that doesn’t seem to be working this time though.

However after I tried switching dkms from packman to the bumblebee repo the error message seems to have changed:

Output of nvidia-bumblebee-343.22-1.1.x86_64.rpm %posttrans script:
    ++ '' -x /usr/sbin/dkms ']'
    ++ /usr/sbin/dkms add -m nvidia -v 343.22 --rpm_safe_upgrade
    
    Creating symlink /var/lib/dkms/nvidia/343.22/source ->
                     /usr/src/nvidia-343.22
    
    DKMS: add completed.
    ++ /usr/sbin/dkms build -m nvidia -v 343.22
    
    Kernel preparation unnecessary for this kernel.  Skipping...
    
    Building module:
    cleaning build area....(bad exit status: 2)
    make KERNELRELEASE=3.16.6-2-desktop -C /lib/modules/3.16.6-2-desktop/build SUBDIRS=/var/lib/dkms/nvidia/343.22/build modules..........
    cleaning build area....(bad exit status: 2)
    
    DKMS: build completed.
    ++ /usr/sbin/dkms install -m nvidia -v 343.22
    
    nvidia:
    Running module version sanity check.
     - Original module
       - No original module exists within this kernel
     - Installation
       - Installing to /lib/modules/3.16.6-2-desktop/updates/
    Adding any weak-modules
    
    depmod....
    
    Backing up initrd-3.16.6-2-desktop to /boot/initrd-3.16.6-2-desktop.old-dkms
    Making new initrd-3.16.6-2-desktop
    (If next boot fails, revert to initrd-3.16.6-2-desktop.old-dkms image)
    dracut....(bad exit status: 1)
    
    -------- Uninstall Beginning --------
    Module:  nvidia
    Version: 343.22
    Kernel:  3.16.6-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.6-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.6-2-desktop to /boot/initrd-3.16.6-2-desktop.old-dkms
    Making new initrd-3.16.6-2-desktop
    (If next boot fails, revert to initrd-3.16.6-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

Also I tried install in dkms-bbswitch from bumblebee-project’s repo and that seems to build just fine, so I’m not sure this is due to just dkms.

Actually, now it still seems to look like that after switching back to packman.
Also after I uninstall nvidia, zypper says systemd-udevd was using some of the deleted files, specifically /lib/modules/3.16.6-2-desktop/modules.dep.bin, /lib/modules/3.16.6-2-desktop/modules.builtin.bin, /lib/modules/3.16.6-2-desktop/modules.alias.bin and /lib/modules/3.16.6-2-desktop/modules.symbols.bin, though those files still seems to be there afterwards.

Strange. AFAICS they are the same version anyway.

Probably the switch cleaned up some mess?

Also I tried install in dkms-bbswitch from bumblebee-project’s repo and that seems to build just fine, so I’m not sure this is due to just dkms.

Well, this time the nivida installation did not fail, the creation of the initrd did AFAICS.

As I said, I’m not experienced with dkms, but I’d suggest to just rebuild the initrd manually as the message suggests.

sudo mkinitrd

If you get errors, please post them.

# mkinitrd
Creating initrd: /boot/initrd-3.16.6-2-desktop
Executing: /usr/bin/dracut --logfile /var/log/YaST2/mkinitrd.log --force --force-drivers "nvidia    nvidia    nvidia      nvidia       nvidia" /boot/initrd-3.16.6-2-desktop 3.16.6-2-desktop
*** Including module: bash ***
*** Including module: warpclock ***
*** Including module: i18n ***
*** Including module: ifcfg ***
*** Including module: drm ***
*** Including module: plymouth ***
*** Including module: btrfs ***
*** Including module: crypt ***
*** Including module: dm ***
Skipping udev rule: 64-device-mapper.rules
Skipping udev rule: 60-persistent-storage-dm.rules
Skipping udev rule: 55-dm.rules
*** Including module: kernel-modules ***
Omitting driver i2o_scsi
*** Including module: lvm ***
Skipping udev rule: 64-device-mapper.rules
Skipping udev rule: 56-lvm.rules
Skipping udev rule: 60-persistent-storage-lvm.rules
*** 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 ***
modprobe: option '--set-version' requires an argument
Failed to install module nvidia
modprobe: option '--set-version' requires an argument
Failed to install module nvidia
modprobe: option '--set-version' requires an argument
Failed to install module nvidia
modprobe: option '--set-version' requires an argument
Failed to install module nvidia
modprobe: option '--set-version' requires an argument
Failed to install module nvidia
*** 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.luks.uuid=luks-a3260cf6-79ab-439a-b1f9-5e1571349c03
 rd.lvm.lv=system/swap
 rd.lvm.lv=system/root
 resume=/dev/mapper/system-swap
root=/dev/mapper/system-root rootflags=rw,relatime,space_cache rootfstype=btrfs
*** Creating image file ***
*** Creating image file done ***
Update bootloader...

Sorry for the delay.

Hm, I’m not experienced with Bumblebee, but I don’t think the nvidia kernel module should be copied to the initrd. And then even 5 times? Looks a bit funny…

AFAICS this list is taken from /etc/sysconfig/kernel, in particular the setting “INITRD_MODULES”. Can you please post that file?
If the line INITRD_MODULES=“…” mentions nvidia (5 times probably), remove that and run mkinitrd again.

There is indeed:

INITRD_MODULES="  nvidia    nvidia    nvidia      nvidia        nvidia"

Also:

DOMU_INITRD_MODULES="xennet xenblk  nvidia    nvidia    nvidia      nvidia        nvidia"

However removing it doesn’t seem to change anything

Well, at least the error messages when running mkinitrd should be gone now, no?

So did you run mkinitrd again?

Your problem was that you couldn’t install nvidia-bumblebee.
But this should be fixed now IIUIC.
I take it that bumblebee/switching to nvidia is not working?
Details?

Sorry about the delay
Anyway, removing “nvidia” from “/etc/sysconfig/kernel” does make the error go away when running mkinitrd, but the nvidia module still doesn’t get installed.
Also “nvidia” gets added to “/etc/sysconfig/kernel” whenever I install it, so there is probably a reason for it to add it. It doesn’t get removed when I uninstall it though which is the is the reason it was repeated five times.
Also doesn’t the error occur when it’s getting build?

cleaning build area....(bad exit status: 2)

Which version of nvidida-bumblebee are you trying to install then, i.e. from what repo?
I cannot find anything in the specfile that touches /etc/sysconfig/kernel (for the version in X11:Bumblebee).

Also doesn’t the error occur when it’s getting build?

cleaning build area....(bad exit status: 2)

Probably you’re right. I overlooked that (cleaning build area doesn’t sound that critical anyway).

Well, without more information why that failed, I can only suggest to clean out anything regarding the nvidia kernel module build. But I have no idea where that “build area” is. Probably try to remove /var/lib/dkms/nvidia/ completely and try to install the driver from scratch (i.e. remove it completely first) again.

OTOH, the driver in the Bumblebee repo has been upgraded to 343.36 meanwhile. Normally the version number should be included in the directories used, so maybe try to remove the old version completely and install the new one.

I face similar problem when trying to instal nvidia-bumblebee on clean system.

Output of zypper:

Output of nvidia-bumblebee-343.36-1.1.x86_64.rpm %posttrans script:    ++ '' -x /usr/sbin/dkms ']'
    ++ /usr/sbin/dkms add -m nvidia -v 343.36 --rpm_safe_upgrade
    
    Creating symlink /var/lib/dkms/nvidia/343.36/source ->
                     /usr/src/nvidia-343.36
    
    DKMS: add completed.
    ++ /usr/sbin/dkms build -m nvidia -v 343.36
    
    Kernel preparation unnecessary for this kernel.  Skipping...
    
    Building module:
    cleaning build area....(bad exit status: 2)
    make KERNELRELEASE=3.16.6-2-desktop -C /lib/modules/3.16.6-2-desktop/build SUBDIRS=/var/lib/dkms/nvidia/343.36/build modules..............
    cleaning build area....(bad exit status: 2)
    
    DKMS: build completed.
    ++ /usr/sbin/dkms install -m nvidia -v 343.36
    
    nvidia:
    Running module version sanity check.
     - Original module
       - No original module exists within this kernel
     - Installation
       - Installing to /lib/modules/3.16.6-2-desktop/updates/
    Adding any weak-modules
    
    depmod.......
    
    Backing up initrd-3.16.6-2-desktop to /boot/initrd-3.16.6-2-desktop.old-dkms
    Making new initrd-3.16.6-2-desktop
    (If next boot fails, revert to initrd-3.16.6-2-desktop.old-dkms image)
    dracut....(bad exit status: 1)
    
    -------- Uninstall Beginning --------
    Module:  nvidia
    Version: 343.36
    Kernel:  3.16.6-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.6-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.6-2-desktop to /boot/initrd-3.16.6-2-desktop.old-dkms
    Making new initrd-3.16.6-2-desktop
    (If next boot fails, revert to initrd-3.16.6-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

And when i try to run mkinitrd :

Creating initrd: /boot/initrd-3.16.6-2-desktopExecuting: /usr/bin/dracut --logfile /var/log/YaST2/mkinitrd.log --force --force-drivers nvidia /boot/initrd-3.16.6-2-desktop 3.16.6-2-desktop
*** Including module: bash ***
*** Including module: warpclock ***
*** Including module: i18n ***
*** 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 ***
modprobe: option '--set-version' requires an argument
Failed to install module nvidia
*** 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 ***
*** Store current command line parameters ***
Stored kernel commandline:
rd.driver.pre=nvidia
 resume=UUID=2a911705-f910-4382-8023-fb0471cbf6fe
root=UUID=ab5412cc-98a0-4e38-9583-197348e90615 rootflags=rw,relatime,data=ordered rootfstype=ext4
*** Creating image file ***
*** Creating image file done ***
Update bootloader...



I cant find out why do i get these errors.

What does

dmesg | grep bbswitch

return?

What’s the content of your /etc/modprobe.d/50-bbswitch.conf ?

Did you already try this?
https://forums.opensuse.org/showthread.php/502460-Hints-to-get-Bumblebee-working-on-an-Optimus-laptop-with-discrete-Nvidia-graphics-card?p=2681995#post2681995

Thank you for your response.

dmesg | grep bbswitch
   19.057219] bbswitch: version 0.8
   19.057230] bbswitch: Found integrated VGA device 0000:00:02.0: \_SB_.PCI0.GFX0
   19.057238] bbswitch: Found discrete VGA device 0000:01:00.0: \_SB_.PCI0.PEG0.PEGP
   19.057431] bbswitch: detected an Optimus _DSM function
   19.057518] bbswitch: Succesfully loaded. Discrete card 0000:01:00.0 is on
  106.977175] bbswitch: disabling discrete graphics
  108.119812] bbswitch: enabling discrete graphics
  165.834103]  arc4 aesni_intel aes_x86_64 lrw gf128mul glue_helper ablk_helper cryptd mei_me mei lpc_ich i2c_i801 mfd_core joydev pcspkr tg3 sdhci_pci ptp sdhci pps_core libphy mmc_core ath9k ath9k_common ath9k_hw ath mac80211 cfg80211 rfkill uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_core v4l2_common videodev soundcore shpchp serio_raw battery ac processor dm_mod sr_mod cdrom i915 i2c_algo_bit drm_kms_helper drm xhci_hcd button wmi video sg bbswitch(O)
  165.837059] bbswitch: disabling discrete g raphics
  169.845521] bbswitch: enabling discrete graphics
  183.953653] bbswitch: disabling discrete graphics
cat /etc/modprobe.d/50-bbswitch.conf 
options bbswitch load_state=-1 unload_state=1



nouveau is blacklisted

Tried that, didn’t help.

Do you really need /etc/sysconfig/kernel ?
Try moving this file to /root

mv /etc/sysconfig/kernel /root

and retry ‘dkms install nvidia/343.36’ and if no errors occur, ‘mkinitrd’.

I hadn’t had this file /etc/sysconfig/kernel on my system after installing from scratch but having problems with installing the nvidia driver
like you have, I generated this /etc/sysconfig/kernel file according to another post with the following content (I left the # commentary lines):

INITRD_MODULES=" "

NO_KMS_IN_INITRD="no"


DOMU_INITRD_MODULES="xennet xenblk"

ACPI_DSDT=""

It didn’t allow the nvidia driver installation though, but after trying other methods, it even
seemed to have blocked the installation. After removal I got nvidia driver installed.

Tried moving the /etc/sysconfig/kernel file, still got errors.


dracut....(bad exit status: 1)
: There was a problem remaking your initrd.  You must manually remake it
before booting into this kernel.

Manually remaking does not help either.

Contents of the file are the same as yours.

Last idea for now:
Have you installed the kernel-source?
If not, it might be worth a try.

I already have the kernel-source installed. A have also deleted older and newer kernel versions and left only 3.16 installed.
Sadly it didn’t help.

Last resort, with /ect/sysconfig/kernel removed:
zypper remove nvidia-bumblebee nvidia-bumblebee-32bit
remove any nouveau blacklisting
mkinitrd
reboot
zypper in nvidia-bumblebee nvidia-bumblebee-32bit

Keep your fingers crossed.

Still getting the same errors.