Bumblebee & Nvidia Proprietary on SolydXK: Alternate Optirun

Post your tutorials and howtos here.
User avatar
just
Posts: 297
Joined: 07 Nov 2013 08:06
Location: Rovaniemi, Finland

Bumblebee & Nvidia Proprietary on SolydXK: Alternate Optirun

Postby just » 31 Jul 2014 15:24

does optirun behave strangely for you? recently it runs in "alternate mode" here. on first run it fails. the next run, executed immediately after the first one, is successfull. the third run fails again. the fourth succeeds. and so forth. odd runs fail. even ones succeed.

there's an easy solution for this problem. before applying the fix, though, we need to do three checks.
  1. an example of erroneous optirun "alternate" behaviour; let's print the current working directory with optirun:

    Code: Select all

    $ echo "1st run fails" && date +"%Y-%m-%d %H:%M:%S" && optirun pwd
    1st run fails
    2014-07-31 10:33:49
    [  110.582324] [ERROR]Cannot access secondary GPU - error: [XORG] (EE) NVIDIA(GPU-0): Failed to initialize the NVIDIA GPU at PCI:1:0:0.  Please
    [  110.582355] [ERROR]Aborting because fallback start is disabled.
    
    $ echo "2nd run succeeds" && date +"%Y-%m-%d %H:%M:%S" && optirun pwd
    2nd run succeeds
    2014-07-31 10:34:08
    /home/just
    
    $ echo "3rd run fails" && date +"%Y-%m-%d %H:%M:%S" && optirun pwd
    3rd run fails
    2014-07-31 10:34:17
    [  137.445351] [ERROR]Cannot access secondary GPU - error: [XORG] (EE) Server terminated successfully (0). Closing log file.
    [  137.445409] [ERROR]Aborting because fallback start is disabled.
    
    $ echo "4th run succeeds" && date +"%Y-%m-%d %H:%M:%S" && optirun pwd
    4th run succeeds
    2014-07-31 10:34:36
    /home/just
    
    $ 
    
    does optirun behave the same way for you? if yes, proceed with next check. otherwise, this howto is not of much help for you.
  2. check the current RCU's wakeup interval
    • reboot
    • before running any program with optirun, execute:

      Code: Select all

      $ cat /sys/module/rcutree/parameters/rcu_idle_gp_delay
      4
      $ 
      
    • does it return 4, the default value (which is not good in this context)? if yes, proceed with next check. otherwise, this howto is not of much help for you.
  3. check optirun with lower RCU's wakeup interval value

    in my tests, 1 worked perfectly:

    Code: Select all

    $ sudo tee /sys/module/rcutree/parameters/rcu_idle_gp_delay <<<1
    [sudo] password for just: 
    1
    $
    
    try to run some commands / programs with optirun afterwards. does it works correctly, like here:

    Code: Select all

    $ echo "Nth run" && date +"%Y-%m-%d %H:%M:%S" && optirun pwd
    Nth run
    2014-07-31 13:25:43
    /home/just
    $ 
    
    if yes, proceed to the next point, which applies the solution. otherwise, this howto is not of much help for you.
  4. make the solution permanent
    • in grub, simply add the following parameter at the end of kernel's boot line:

      Code: Select all

      rcutree.rcu_idle_gp_delay=1 
    • if you're using grub1, edit the menu.lst:

      Code: Select all

      kernel (hd1,12)/boot/vmlinuz-3.14-1-amd64 showopts root=/dev/sdb13 ro resume=/dev/sda3 quiet splash rcutree.rcu_idle_gp_delay=1 
      initrd (hd1,12)/boot/initrd.img-3.14-1-amd64
    • if you're using grub2, edit the /etc/default/grub and modify the GRUB_CMDLINE_LINUX_DEFAULT line:

      Code: Select all

      GRUB_CMDLINE_LINUX_DEFAULT="quiet splash rcutree.rcu_idle_gp_delay=1"
    • remember to update-grub after that
    • reboot
  5. final check

    optirun is smooth as silk now:

    Code: Select all

    $ echo "1st run succeeds" && date +"%Y-%m-%d %H:%M:%S" && optirun pwd
    1st run succeeds
    2014-07-31 10:43:22
    /home/just
    
    $ echo "2nd run succeeds" && date +"%Y-%m-%d %H:%M:%S" && optirun pwd
    2nd run succeeds
    2014-07-31 10:43:34
    /home/just
    
    $ echo "3rd run succeeds" && date +"%Y-%m-%d %H:%M:%S" && optirun pwd
    3rd run succeeds
    2014-07-31 10:43:45
    /home/just
    
    $ echo "4th run succeeds" && date +"%Y-%m-%d %H:%M:%S" && optirun pwd
    4th run succeeds
    2014-07-31 10:43:56
    /home/just
    
    $ 
  6. references used for this howto

Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 1 guest