I tried to copy this in a local file and use it to run glxinfo -B but it never switches to my nvidia GPU, always using the Intel one. Do you have nvidia-settings installed btw?
wdym copy this to a local file and use it to run glxinfo? You mean just the script?
Anyways, if I run it, I get this:
nvidia-offload glxinfo -B
name of display: :0
display: :0 screen: 0
direct rendering: Yes
Memory info (GL_NVX_gpu_memory_info):
Dedicated video memory: 2048 MB
Total available memory: 2048 MB
Currently available dedicated video memory: 1998 MB
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce MX150/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 545.29.02
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL version string: 4.6.0 NVIDIA 545.29.02
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 545.29.02
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
And yes, I do have nvidia-settings. My Nvidia GPU shows up as GPU0 in there. Plus some additional info obviously (like the bus id mentioned in the config).
Also you should check lsmod | grep nvidia to see if the kernel module is actually loaded. Which of course it won’t be now, that it’s not even in the nix store.
My kernel was 6.1. Will try boot.kernelPackages = pkgs.linuxPackages_zen;. It’s supposed to give me kernel 6.6.1. I am still not sure what kernel.kernelAtLeast means though. I assume the kernel has to be minimum v6.2 for the package to work?
I’d read that it has to be at least 6.2 for the package to be broken. Without checking what the function actually does, I’d say it evaluates to true on kernel 6.2 and above. Hence the package should be broken on kernel 6.2 and above.
Why are you using the zen kernel? That one is modified. No idea what that will do in your case.
Well, I am not sure about the exact nature of your config. But what I can gather from this is that this package legacy_390 is likely to not work on kernel 6.2 and above.
I myself am running 6.1.63 on this machine right now btw. (Edit: I just use linuxPackages as kernel packages for NixOS, which should give you the LTS. According to kernel.org this is at 6.1.69 right now.)
Generally speaking I am also not totally familiar with what your system configuration as a whole is. It appears to be somewhat older, based on Intel Ivy Bridge or Haswell or so. Also your Nvidia driver is not very up to date, is that because your GPU is not supported by newer versions?
You’re right! I went back to the default LTS kernel, 6.1.65. However, it still didn’t install. I had to manually add linuxKernel.packages.linux_6_1.nvidia_x11_legacy390 to environment.systemPackages. And indeed it did install without issues. I guess the hardware.nvidia config doesn’t support old drivers or something, not sure.
Yes, my hardware is old, the GPU is so old that it doesn’t even support vulkan lol.
I think I’m getting closer. I just need to figure out how to load the nvidia kernel module because bumblebee shows this error nixos bumblebeed[910]: Could not load GPU driver. I wonder if I should add "nvidia" to the boot.initrd.kernelModules list. I already added it to the boot.kernelModules one.
Yes, it is. I checked the Nvidia website, and used to run it when I was running Arch. It is working now, but bumblebee for some reason installs a different version of the Nvidia driver. Thanks for your help!
I got the same problem for my old 4200M card.
Did you fix your issue ? I so, can you post you configuration.nix file (at least the part concerned by your kernel, opengl and nvidia) ?
videoDriver must be nvidia in order to be able to load the kernel module.
services.xserver.videoDrivers = [ "nvidia" ];
After that, the kernel module is loaded, got nvidia-settings in my path, but it doesn’t find any display.
In the end, I still don’t know if my GPU is in use or if the integrated intel GPU is used.
Also, my laptop performances seems ok but the mouse is lagggging a lot which make it unusable.
Hope we’ll find a solution to this problem.
And, does anyone know how to check if your nvidia GPU is compatible with optimus ? Nvidia has a website : Optimus | Supported GPUs | GeForce but it seems completely broken…
If my card is not supported by optimus, how can the intel card and nvidia one work together ?