Nixos Toshiba L750

Hi all

I have the following laptop and I’m at a loss how to get the dedicated gpu to run.

The laptop is a old Toshiba Satellite L750 Laptop HD Intel® Core™ i7 i7-2670QM with NVIDIA GeForce GT 525M

How do I configure it to use the Nvidia?

I’ve tried the following safe method and it worked, but, has no Nvidia:

{ config, pkgs, ... }: {
  nixpkgs.config.packageOverrides = pkgs: {
    vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
  };
  hardware.opengl = {
    enable = true;
    extraPackages = with pkgs; [
      intel-media-driver   # LIBVA_DRIVER_NAME=iHD
      # intel-vaapi-driver
      vaapiIntel                # LIBVA_DRIVER_NAME=i965 
      vaapiVdpau
      libvdpau-va-gl
    ];
  };
}

Then tried the following and the system hangs on rebuild:

{ config, pkgs, ... }:

{
  specialisation = {
    nvidia.configuration = {
      # Nvidia Configuration
      services.xserver.videoDrivers = [ "nvidia" ];
      hardware.opengl.enable = true;

      # Optionally, you may need to select the appropriate driver version for your specific GPU.
      hardware.nvidia.package =
        config.boot.kernelPackages.nvidiaPackages.stable;

      # nvidia-drm.modeset=1 is required for some Wayland compositors, e.g., sway
      hardware.nvidia.modesetting.enable = true;

      hardware.nvidia.prime = {
        sync.enable = true;

        # Bus ID of the NVIDIA GPU. You can find it using lspci, either under 3D or VGA
        nvidiaBusId = "PCI:1:0:0";

        # Bus ID of the Intel GPU. You can find it using lspci, either under 3D or VGA
        intelBusId = "PCI:0:2:0";
      };
    };
  };
}

Here is the lspci:

[tolga@nixos:~]$ lspci
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)
00:1c.5 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 6 (rev b4)
00:1c.6 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 7 (rev b4)
00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation HM65 Express Chipset LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port Mobile SATA AHCI Controller (rev 04)
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)
01:00.0 VGA compatible controller: NVIDIA Corporation GF108M [GeForce GT 525M] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GF108 High Definition Audio Controller (rev a1)
08:00.0 USB controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 04)
09:00.0 Network controller: Qualcomm Atheros AR9285 Wireless Network Adapter (PCI-Express) (rev 01)
0a:00.0 Ethernet controller: Qualcomm Atheros AR8151 v2.0 Gigabit Ethernet (rev c0)

[tolga@nixos:~]$

If i used the following, i would be presented with the tty login screen with no gui:

{ lib, config, pkgs, ... }:
hardware = {
    nvidia = {
      modesetting.enable = true;
      nvidiaPersistenced = true;

      # Enable the nvidia settings menu
      nvidiaSettings = true;

      # Enable power management (do not disable this unless you have a reason to).
      # Likely to cause problems on laptops and with screen tearing if disabled.
      powerManagement.enable = true;

      # Optionally, you may need to select the appropriate driver version for your specific GPU.
      package = config.boot.kernelPackages.nvidiaPackages.stable;

      # hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.legacy_340
      # hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.legacy_390
    };

    # Direct Rendering Infrastructure (DRI) support, both for 32-bit and 64-bit, and 
    # Make sure opengl is enabled
    opengl = {
      enable = true;
      driSupport = true;
      driSupport32Bit = true;

      # Install additional packages that improve graphics performance and compatibility.
      extraPackages = with pkgs; [
        intel-media-driver 
        vaapiIntel
        vaapiVdpau
        libvdpau-va-gl
        vulkan-validation-layers

      ];
    };
  };

  # Tell Xorg to use the nvidia driver (also valid for Wayland)
  services.xserver.videoDrivers = [ "nvidia" ];

}

And lastly, in my hardware configuration:
boot.initrd.kernelModules = [ ];

Any guidence be much appreciated, thank you
Tolga

You should switch to older drivers hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.legacy_390. Check What's a legacy driver? | NVIDIA

1 Like

Thanks, Ive tried that and get the tyy screen, no gui

I have Nvidia Geforce 630M on my old laptop. I tried using this

{
  hardware.bumblebee = {
    enable = true;
    driver = "nvidia";
    pmMethod = "bbswitch";
  };
  nixpkgs.overlays = [
    (_self: super: {
      bumblebee = super.bumblebee.overrideAttrs
        (oldAttrs: { meta = oldAttrs.meta // { broken = false; }; });
      linuxPackages = super.linuxPackages.extend
        (_lpself: lpsuper: { nvidia_x11 = lpsuper.nvidia_x11_legacy390; });
      steam = super.steam.override {
        withPrimus = true;
        extraPkgs = pkgs: [ pkgs.bumblebee pkgs.glxinfo ];
      };
    })
  ];
}

but most games didn’t work. Also, your GPU is too old for Prime.

in which snippet would this go into?

I haven’t touched specialisations and so I don’t know if they work with hardware changes. Most hardware changes require a reboot so I would switch with sudo nixos-rebuild boot. Try replacing hardware.nvidia configs.