Old nvidia laptop setting doesnt work

Hello everyone, I have an laptop with an old gpu and an iGPU from intel. I can not get it to work with nixos. But i need its CUDA capabilities. Here is the device.

$  lspci | grep NVIDIA
06:00.0 3D controller: NVIDIA Corporation GP108M [GeForce MX250] (rev a1)

I installed the nixos via the KDE installer iso in a flash drive. But the hardware-configuration.nix file doesnt have anything related to nvidia. And the nvidia-smi command doesn’t work. And also pytorch doesnt see my GPU.

I tried to follow the nixos wiki but after i had applied these changes

These changes are applied but the nvidia-smi command still doesn’t work and after rebooting i lose the graphical interface. The computer starts from tty text interface. So i have to rollback and undo my changes.

I am very lost, what can i do to diagnose this issue? I dont know much about kernel modules. So there may be a problem but I dont know. Any suggestion would help.

Thank you for reading.

With that config you linked, did you set both bus IDs to match your system?

The part that took me a while to figure out, is that especially with intelBusId (or in my case amdBusId) you might have to convert it from hex to decimal.

1 Like

Here is the nvidia-prime section:

  hardware.nvidia.prime = {
		offload = {
			enable = true;
			enableOffloadCmd = true;
		};
		intelBusId = "PCI:0:2:0";
		nvidiaBusId = "PCI:6:0:0";
	};

I think so, as you can see my lspci output says its 6 for nvidia. It is correct right?

What information i should look for? Is there an hidden error message somewhere. : (

You have to also look through and find the value for intelBusId.

1 Like

I did actually. I should have mentioned it sorry. These numbers are from lspci:

$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation Iris Plus Graphics G7 (rev 07)

Okay, in that case I’d recommend to review the output of journalctl -b for errors, after it fails to bring up the desktop environment (So, from the console. Or you can boot your older generation and use journalctl --list-boots to get the argument to -b).