Results 1 to 4 of 4

Thread: Cuda + Nvidia + bumblebee + codecs "safe" way

  1. #1
    Join Date
    Oct 2014
    Location
    Switzerland
    Posts
    438

    Default Cuda + Nvidia + bumblebee + codecs "safe" way

    Hello everyone,

    In short, by default I work on a laptop with Nvidia dGPU and script cuda codes on it, and I also watch movies on the laptop. Therefore the following set of instructions are what I install in the beginning. I put together what I learned mostly from this thread (https://forums.opensuse.org/showthre...strously/page2).

    0. I install OpenSUSE LEAP 42.3/15.0/15.1+ with a bootmode: nomodeset. This means the laptop should have in
    Code:
    /etc/default/grub
    Code:
    GRUB_CMDLINE_LINUX_DEFAULT="splash=silent quiet mitigations=auto nomodeset"
    with no update applied whatsoever. Just fresh install with nomodeset in default boot mode.

    1. I add default Nvidia repository from the community packages.
    Code:
    zypper addrepo --refresh https://download.nvidia.com/opensuse/leap/15.1 NVIDIA
    Mind you that the version number such as 15.1 should be whichever version you are using or tumbleweed (for which case instead /leap/15.1).
    source (https://en.opensuse.org/SDB:NVIDIA_drivers)

    Remember do not update or install anything.

    2. Set up cuda repository from Nvidia's website (https://developer.nvidia.com/cuda-downloads).
    They typically provide an rpm package which adds necessary repos. You can do this from a terminal.
    Code:
    sudo zypper addrepo http://developer.download.nvidia.com/compute/cuda/repos/opensuse15/x86_64/cuda-opensuse15.repo
    Please note that they don't distinguish OpenSUSE 15.1 from 15.0, if you add their repo they will keep the necessary packages related to cuda up to date.

    3. Now make sure all of the packages are loaded and refreshed.
    Code:
    sudo zypper ref
    trust always on everything.

    4.Install cuda which then in turn will lock, and install nvidia driver that it considers most compatible and locks the kernel and also blacklists nouveau automatically.
    Code:
    sudo zypper in cuda-tools-10-1 cuda-toolkit-10-1 cuda
    Do not reboot yet.

    5.Remove nomodeset from
    Code:
    /etc/default/grub
    Code:
    GRUB_CMDLINE_LINUX_DEFAULT="splash=silent quiet mitigations=auto nomodeset"
    Make sure that grub is updated with
    Code:
    sudo mkinitrd
    6.Reboot.

    7. Update
    Code:
    sudo zypper up
    8.Set up codecs
    Code:
    sudo zypper addrepo -f http://packman.inode.at/suse/openSUSE_Leap_15.1/ packman
    sudo zypper addrepo -f http://opensuse-guide.org/repo/openSUSE_Leap_15.1/ dvd
    Be sure to use the right version then install.
    Code:
    sudo zypper install --allow-vendor-change ffmpeg lame gstreamer-plugins-bad gstreamer-plugins-ugly gstreamer-plugins-ugly-orig-addon gstreamer-plugins-libav libavdevice56 libavdevice58 libdvdcss2 vlc-codecs
    Then make sure there are no stray packages clinging to other repos.
    Code:
    sudo zypper dup --allow-vendor-change --from http://packman.inode.at/suse/openSUSE_Leap_15.1/
    Again careful with the repos.
    source (https://opensuse-guide.org/codecs.php)

    9.Reboot.
    10. Update.
    11. If updated, then reboot again.

    12. Install bumblebee.
    Code:
    sudo zypper in bumblebee bbswitch
    Code:
    sudo usermod -aG bumblebee $USER
    sudo usermod -aG video $USER
    turn it on
    Code:
    sudo systemctl enable bumblebeed
    sudo systemctl start bumblebeed
    Install 32 bit libraries:
    Code:
    sudo zypper in Mesa-libGL1-32bit libX11-6-32bit primus-32bit
    Install Mesa-demo for testing.
    Code:
    sudo zypper in Mesa-demo-x Mesa-demo
    configure
    Code:
    /etc/bumblebee/bumblebee.conf
    Change the following lines under [bumblebeed]:
    Code:
    TurnCardOffAtExit=true
    Driver=nvidia
    Change the following lines under [driver-nvidia]:
    Code:
    LibraryPath=/usr/lib64/:/usr/lib/
    XorgModulePath=/usr/lib64/nvidia/xorg/,/usr/lib64/xorg/modules
    XorgConfFile=/etc/bumblebee/xorg.conf.nvidia
    Setup xrog path and symbollic link:
    Code:
    sudo mkdir -p /usr/lib64/nvidia/xorg/modules/extensions
    sudo ln -s /usr/lib64/xorg/modules/extensions/nvidia/nvidia-libglx.so /usr/lib64/nvidia/xorg/modules/extensions/libglx.so
    reinitiate kernel.
    Code:
    mkinitrd
    At least all of my laptops needed the following. You need to change a line in:
    Code:
    /etc/modprobe.d/50-bbswitch.conf
    Code:
    options bbswitch load_state=-1 unload_state=1
    source: (https://en.opensuse.org/SDB:NVIDIA_Bumblebee)
    13. reboot, update, reboot, and test. First with:
    Code:
    optirun --status
    Bumblebee status: Ready (3.2.1). X inactive. Discrete video card is off.
    Then test with mesa demo package
    Code:
    optirun glxgears 
    optirun glxspheres
    If everything works, now set up your application launcher to change its instance of nvidia-settings to

    Code:
    optirun -b none nvidia-settings -c :8
    Also within nvidia-settings or "NVIDIA X Server Settings", NEVER touch "save to X Configuration File", or touch anything for that matter in the "X Server Display Configuration" tab. This will most likely going result in not being able to boot to DE.

    From my experience the above procedure had to be followed in the specified sequence. Any missing step or wrong sequence broke my system.

    I also found a way to make steam to use optirun properly for most cases, but I will not cover there here.

    -SJL

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    27,829
    Blog Entries
    15

    Default Re: Cuda + Nvidia + bumblebee + codecs "safe" way

    Hi
    A few observations...

    After changes to /etc/default/grub, the command to run should be;

    Code:
    grub2-mkconfig -o /boot/grub2/grub.cfg
    What about blacklisting the nouveau module? Perhaps this should be added temporarily to the grub options?

    I prefer the manual install of cuda as can set override options, I also install cudann, but this is a manual (or can script) process.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3
    Join Date
    Oct 2014
    Location
    Switzerland
    Posts
    438

    Default Re: Cuda + Nvidia + bumblebee + codecs "safe" way

    Hello malcolmlewis,
    Instead of
    Code:
    grub2-mkconfig -o /boot/grub2/grub.cfg
    I typically run
    Code:
    mkinitrd
    which is less efficient method of updating grub.

    Also, on step 0. I don't really mention it because this should have been set under "Boot Loader" during installation.

    As for blacklisting nouveau, this is typically done automatically by the nvidia driver under
    Code:
    /etc/modprobe.d/nvidia-default.conf 
    blacklist nouveau
    during installation, so I didn't mention it seperately.

    I have tried manual installation of Nvidia and Cuda but I am not quite sure how to do it stably and without breaking it during an update let alone to write a set of instructions for it. Hence why I mentioned "safe" way as the title.

    Thank you.
    -SJL

  4. #4
    Join Date
    Oct 2014
    Location
    Switzerland
    Posts
    438

    Default Re: Cuda + Nvidia + bumblebee + codecs "safe" way

    For future reference, a recent update of cuda+nvidia driver +bumblebee broke. I compiled a solution to it. This can be found here: https://forums.opensuse.org/showthre...88#post2921688

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •