Page 1 of 2 12 LastLast
Results 1 to 10 of 11

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

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

    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
    29,858
    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
    756

    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
    756

    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

  5. #5
    Join Date
    Oct 2014
    Location
    Switzerland
    Posts
    756

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

    Hello,

    It is right now 2020-07-22 and I have just installed Tumbleweed (the latest version in repo) on an external USB-3.1<->NVMe<->USB3.0 enclosure.

    To my surprise my bumblebee method works 100% still. I am a little bit puzzled because I thought that no one is supporting Bumblebee anymore, has that changed? I have not yet tested on LEAP 15.2

  6. #6
    Join Date
    Oct 2014
    Location
    Switzerland
    Posts
    756

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

    For my future reference, TW with kernel 5.7.9-1-default
    requires
    Code:
    /etc/modprobe.d/50-bbswitch.conf       
    
    to be set to:
    Code:
    
    options bbswitch load_state=0 unload_state=1
    
    on Alienware 15 (2015)

  7. #7
    Join Date
    Oct 2014
    Location
    Switzerland
    Posts
    756

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

    On Lenovo T480 with NVIDIA MX150 dGPU the above method works still on LEAP 15.2 kernel 5.3.18-lp152.36-default with nvidia-gfxG05...

  8. #8
    Join Date
    Oct 2014
    Location
    Switzerland
    Posts
    756

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

    Odd development on LEAP 15.2 on Sept 7 2020.
    Kernel:
    Code:
    ~> uname -a
    Linux Zooricker 5.3.18-lp152.36-default #1 SMP Tue Aug 18 17:09:44 UTC 2020 (885251f) x86_64 x86_64 x86_64 GNU/Linux
    
    when running optirun as a regular user, I get:
    Code:
    ~> optirun glxspheres
    Polygons in scene: 62464 (61 spheres * 1024 polys/spheres)
    GLX FB config ID of window: 0xad (8/8/8/0)
    Visual ID of window: 0x21
    X Error of failed request:  BadValue (integer parameter out of range for operation)
      Major opcode of failed request:  151 (GLX)
      Minor opcode of failed request:  24 (X_GLXCreateNewContext)
      Value in failed request:  0x0
      Serial number of failed request:  29
      Current serial number in output stream:  30
    
    with sudo permissions:
    Code:
    ~> sudo optirun glxspheres
    Polygons in scene: 62464 (61 spheres * 1024 polys/spheres)
    ERROR in line 637:
    Could not open display
    
    but as root:
    Code:
     optirun glxspheres
    Polygons in scene: 62464 (61 spheres * 1024 polys/spheres)
    GLX FB config ID of window: 0xad (8/8/8/0)
    Visual ID of window: 0x21
    Context is Direct
    OpenGL Renderer: GeForce MX150/PCIe/SSE2
    141.912480 frames/sec - 158.374327 Mpixels/sec
    
    I've tried re-setting the user permissions
    Code:
    sudo usermod -aG bumblebee $USER
         sudo usermod -aG video $USER
    
    and
    Code:
    sudo gpasswd -a $USER bumblebee  
    sudo gpasswd -a $USER video
    
    yielded no change... Still looking.

  9. #9
    Join Date
    Oct 2014
    Location
    Switzerland
    Posts
    756

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

    Solution:
    1. comment out the contents of
    Code:
    /etc/modprobe.d/09-nvidia-modprobe-pm-G05.conf
    #options nvidia NVreg_DynamicPowerManagement=0x01
    
    apparently the power managment requires super user previlages.
    2.re-link broken symbolic link for nvidia-libglx.so with the appropriate one.
    Code:
    ln -sf /usr/lib64/xorg/modules/extensions/libglxserver_nvidia.so /usr/lib64/nvidia/xorg/modules/extensions/libglx.so
    
    The naming convention changes from libglx.so to libglxserver_nvidia.so apparently.

    Then recompile the kernel
    Code:
    mkinitrd

  10. #10
    Join Date
    Oct 2014
    Location
    Switzerland
    Posts
    756

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

    I got my TW bumblebee to work again by installing gfx05 package and using the same symlink as I did for LEAP 15.2, and I had to make one more change,
    in the file
    Code:
     /etc/bumblebee/xorg.conf.d/xorg.conf.nvidia
    uncomment the BUSID line
    Code:
    #   BusID "PCI:01:00:0"
    to
    Code:
       BusID "PCI:01:00:0"
    for me this works perfectly fine but it depends on the BUSID of the nvidia driver can be seen using lspci.
    Code:
     sudo lspci  |grep -i nvidia
    01:00.0 VGA compatible controller: NVIDIA Corporation GK107GLM [Quadro K2000M] (rev ff)
    It may not be case for everyone.

Page 1 of 2 12 LastLast

Posting Permissions

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