Fix bumblebee kernel panic

Hello world,

I’m just beggining to set up my first NixOS on my Laptop (MSI GS73 VR 6RF) which has an optimus NVIDIA GPU.

Optimus works fine, but when I try to set hardware.bumblebee.enable = true;, I get a kernel panic.

I have seen that this error can be fixed by a workaround : All boots with bumblebee ends with kernel panic · Issue #205 · Bumblebee-Project/Bumblebee · GitHub
Basically, the workaround is done by delaying the bumblebeed startup.

How can I add this sleep 2 command before bumblebee starts ?
Do I have to do some sort of editing on bumblebee.nix:89 ?

My current configuration if that’s of any help :

{ config, pkgs, ... }:

{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
    ];

  ### Boot
  # Use the systemd-boot EFI boot loader.
  boot.loader = {
    systemd-boot.enable = true;
    efi.canTouchEfiVariables = true;
    grub = {
      enable = true;
      version = 2;
      efiSupport = true;
      useOSProber = true;
      devices = ["nodev"];
    };
  };
  
  ### NixPkg
  nixpkgs.config.allowUnfree = true;
  
  ### Nvidia configuration
  # hardware.nvidia.optimus_prime.enable = true;
  # hardware.nvidia.optimus_prime.nvidiaBusId = "PCI:1:0:0";
  # hardware.nvidia.optimus_prime.intelBusId = "PCI:0:2:0";
  hardware.bumblebee =  {
    enable = true;
  };

  ### Other hardware
  sound.enable = true;
  # hardware.pulseaudio.enable = true;
  
  ### Network
  networking.hostName = "akame";
  networking.networkmanager.enable = true; # Networking via Network Manager
  # networking.wireless.enable = true;  # Wireless support via wpa_supplicant

  # networking.proxy.default = "http://user:password@proxy:port/";
  # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
  
  # Firewall.
  # networking.firewall.allowedTCPPorts = [ ... ];
  # networking.firewall.allowedUDPPorts = [ ... ];
  # networking.firewall.enable = false;

  ### Internationalisation
  i18n = {
    consoleFont = "Lat2-Terminus16";
    consoleKeyMap = "fr";
    defaultLocale = "fr_FR.UTF-8";
  };
  time.timeZone = "Europe/Paris";

  ### System packages & services
  environment.systemPackages = with pkgs; [
    wget vim git
  ];

  # Some programs need SUID wrappers, can be configured further or are
  # started in user sessions.
  # programs.mtr.enable = true;
  # programs.gnupg.agent = { enable = true; enableSSHSupport = true; };

  services.openssh.enable = true;
  # services.printing.enable = true;
  
  ### Display
  # Enable the X11 windowing system.
  services.xserver = {
    enable = true;
    layout = "fr";
    libinput.enable = true; # Enable touchpad support.
    # xkbOptions = "eurosign:e";
    # videoDrivers = [ "intel" ];

    # Enable the KDE Desktop Environment.
    displayManager.sddm.enable = true;
    desktopManager.plasma5.enable = true;
  };

  ### Users
  # Define a user account. Don't forget to set a password with ‘passwd’.
  users.users.arsleust = {
    ...
  };
}

Thanks !

Cheers,
Guillaume

Looking at the general specifications in the model’s page, with a GTX 1060, the preferred method should be NVIDIA’s “native” prime render offload solution which isn’t really implemented in nixpkgs yet [1] but is being worked on at the moment.

[1] nvidia: prime render offload by eadwu · Pull Request #66601 · NixOS/nixpkgs · GitHub

1 Like

Thank you very much, I’ll be following that… :slight_smile:

EDIT : I’m curious as to which “general specifications in the model’s page” you are referring to

The normal specifications of the model assuming it hasn’t been internally meddled with and/or changed.