Hello! I’m just getting started with Nix OS and I thought I’d set up a network share on a really old laptop I’ve had lying around for years. I also have an old VGA-only monitor I’d like to use as a dashboard. The laptop is a MacBook Pro 5,3 from 2009 (unfortunately not listed in nixos-hardware). Outputting video to this VGA monitor is my first issue (and I haven’t even gotten to the network share setup yet!).
According to the specs, I have two graphics cards:
- NVIDIA GeForce 9600M GT
- NVIDIA GeForce 9400M
Both of these are legacy devices listed under the 340.xx NVIDIA driver. The laptop also has a Mini DisplayPort port. I have a Mini DisplayPort to VGA adapter with a regular VGA cable and a Mini DisplayPort to HDMI cable. I have not been able to get any output through the VGA adapter, but I can get video out through the Mini DisplayPort to HDMI cable (kind of) connected to another monitor with HDMI input.
The VGA adapter and monitor work: I’ve tested them both with the original MacBook Pro hard drive with Mac OS X installed. However, it only worked after the OS loaded: during boot, there was no output through the VGA adapter, though there was output at all times when using the HDMI cable. This led me to believe that there’s a software layer between the port and the adapter that is not necessary for the direct Mini DisplayPort to HDMI cable.
So far, I have only been able to get video working with the HDMI cable, but only when using nomodeselect
. From the installer, I had to select the nomodeselect
option for the video to work. Without this option, the video looks garbled. By following a guide for NVIDIA drivers, I tried a number of different combinations of the following:
# boot.blacklistedKernelModules = lib.mkDefault [ "i915" ]; # Try disabling integrated graphics
boot.kernelParams = lib.mkDefault [
# "nomodeset"
"nvidia_drm.fbdev=1"
"nvidia-drm.modeset=1"
# "i915.modeset=0" # Try disabling integrated graphics
];
# Display
services.xserver.videoDrivers = [ "nvidia" ];
nixpkgs.config.nvidia.acceptLicense = true;
# hardware.graphics = {
# enable = true;
# };
hardware.nvidia = {
modesetting.enable = true;
forceFullCompositionPipeline = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
# nvidiaPersistenced = true;
open = false;
# nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.legacy_340; # GeForce 9600M GT and GeForce 9400M
# Both graphics cards are NVIDIA; do I use two nvidiaBusId entries?
# prime = {
# sync.enable = true;
# offload = {
# enable = true;
# enableOffloadCmd = true;
# };
};
# Try disabling NVIDIA altogether
# boot.extraModprobeConfig = ''
# blacklist nouveau
# options nouveau modeset=0
# '';
#
# services.udev.extraRules = ''
# # Remove NVIDIA USB xHCI Host Controller devices, if present
# ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{power/control}="auto", ATTR{remove}="1"
# # Remove NVIDIA USB Type-C UCSI devices, if present
# ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{power/control}="auto", ATTR{remove}="1"
# # Remove NVIDIA Audio devices, if present
# ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{power/control}="auto", ATTR{remove}="1"
# # Remove NVIDIA VGA/3D controller devices
# ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", ATTR{power/control}="auto", ATTR{remove}="1"
# '';
# boot.blacklistedKernelModules = [ "nouveau" "nvidia" "nvidia_drm" "nvidia_modeset" ];
Here’s the output to nix-shell -p pciutils --run lspci
:
00:00.0 Host bridge: NVIDIA Corporation MCP79 Host Bridge (rev b1)
00:00.1 RAM memory: NVIDIA Corporation MCP79 Memory Controller (rev b1)
00:03.0 ISA bridge: NVIDIA Corporation MCP79 LPC Bridge (rev b3)
00:03.1 RAM memory: NVIDIA Corporation MCP79 Memory Controller (rev b1)
00:03.2 SMBus: NVIDIA Corporation MCP79 SMBus (rev b1)
00:03.3 RAM memory: NVIDIA Corporation MCP79 Memory Controller (rev b1)
00:03.4 RAM memory: NVIDIA Corporation MCP79 Memory Controller (rev b1)
00:03.5 Co-processor: NVIDIA Corporation MCP79 Co-processor (rev b1)
00:04.0 USB controller: NVIDIA Corporation MCP79 OHCI USB 1.1 Controller (rev b1)
00:04.1 USB controller: NVIDIA Corporation MCP79 EHCI USB 2.0 Controller (rev b1)
00:06.0 USB controller: NVIDIA Corporation MCP79 OHCI USB 1.1 Controller (rev b1)
00:06.1 USB controller: NVIDIA Corporation MCP79 EHCI USB 2.0 Controller (rev b1)
00:08.0 Audio device: NVIDIA Corporation MCP79 High Definition Audio (rev b1)
00:09.0 PCI bridge: NVIDIA Corporation MCP79 PCI Bridge (rev b1)
00:0a.0 Ethernet controller: NVIDIA Corporation MCP79 Ethernet (rev b1)
00:0b.0 SATA controller: NVIDIA Corporation MCP79 AHCI Controller (rev b1)
00:0c.0 PCI bridge: NVIDIA Corporation MCP79 PCI Express Bridge (rev b1)
00:10.0 PCI bridge: NVIDIA Corporation MCP79 PCI Express Bridge (rev b1)
00:15.0 PCI bridge: NVIDIA Corporation MCP79 PCI Express Bridge (rev b1)
00:16.0 PCI bridge: NVIDIA Corporation MCP79 PCI Express Bridge (rev b1)
02:00.0 VGA compatible controller: NVIDIA Corporation G96CM [GeForce 9600M GT] (rev a1)
03:00.0 VGA compatible controller: NVIDIA Corporation C79 [GeForce 9400M] (rev b1)
05:00.0 FireWire (IEEE 1394): LSI Corporation FW643 [TrueFire] PCIe 1394b Controller (rev 07)
And the output to nix-shell -p lshw --command 'sudo lshw -c display'
:
*-display
physical id: 0
bus info: pci@0000:02:00.0
version: a1
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list rom
configuration: driver=nvidia latency=0
resources: irq:20 memory:e4000000-e4ffffff memory:c0000000-cfffffff memory:e2000000-e3ffffff ioport:2000(size=128) memory:e5000000-e507ffff
*-display
physical id: 0
bus info: pci@0000:03:00.0
version: b1
width: 64 bits
clock: 33MHz
capabilities: pm msi bus_master cap_list rom
configuration: driver=nvidia latency=0
resources: irq:21 memory:e6000000-e6ffffff memory:d0000000-dfffffff memory:e0000000-e1ffffff ioport:1000(size=128) memory:e7000000-e701ffff
*-graphics
product: simpledrmdrmfb
physical id: 4
logical name: /dev/fb0
capabilities: fb
configuration: depth=32 resolution=1024,768
When booting with boot.kernelParams = ["nomodeselect"]
and nothing else, I only get the *-graphics
entry.
I’ve just noticed that the *-graphics
entry seems to update the resolution based on which monitor is connected. With my HDMI monitor and the HDMI cable, its resolution is 1920x1080, but with the VGA adapter, it outputs 1024x768. I’m not sure if this is important.
My suspicion is that it has something to do with the *-graphics
and product: simpledrmdrmfb
; perhaps it’s defaulting to a simple graphics driver that doesn’t have that software layer necessary for the VGA adapter to work. This is why I tried adding these entries to boot.kernelParams
:
"nvidia_drm.fbdev=1"
"nvidia-drm.modeset=1"
But that didn’t seem to have any effect.
I’m just about ready to give up on getting the video output working through the adapter. I’m not really sure where to go from here. Any ideas?