NixOS freezing soon after opening chrome

I have a NixOS based LiveCD that I use for a kids Code Club - see config here.

It uses Google Chrome, which I start such that the first time setup stuff is not triggered.
With the latest NixOS repo/chrome version the initial Chrome loads ok but if I close and re-open it, then there start to be some graphical issues, flickering around the screen and then soon after the machine locks up. I’ve tested this on several differents Macs (10-15 years old). Will test on the actual Code Club machines tomorrow- they are windows PCs.

It was working ok a few weeks back, on this build - 804219.36ab78dab7da

The latest I am trying is thia build - 25.05.808129.3385ca0cd7e1

Things to try -

  • see if it occurs with firefox - tried/not seen the issue.
  • try on windows PC, see if still an issue
  • I have added an exception for the broadcom insecure package
  • get chrome versions between nixos versions

LOGS
On the good laptop, no errors about Haswell/gfx - but see those in both cases on the bad laptop, older and newer nixos/chrome

See termbin links below for logs

chrome on latest/nixos/good laptop
https://termbin.com/hc6e

chrome on nixos good livecd/bad laptop
https://termbin.com/s6qx

chrome on nixos bad livecd/bad laptop
https://termbin.com/omdw

I have tried with the latest NixOS installer (25.05.808338), installed chrome via nix-shell and also got the error.

There does seem to be a new popup asking for a password to create a default keyring.

It doesn’t seem to be a problem on the laptop I run NixOS on natively (also a Mac).
Problem Macs

  • iMac 2011 (12,2)
  • MBP mid 2015

Working Mac

  • MacBookPro, either a late 2013 or mid 2014 (11,1)

Firefox seems ok.

I’ve reinstalled NixOS on the iMac (I thought I had SSD issues, but maybe it’s Chrome). I then ran Chrome via nix-shell - seemed ok for 5 mins or so, but then it locked the machine up and I had to reboot it.

There were some disk issues/repairs on booting.

I then tried to do a nix update. I left the machine, and when I came back, the login screen would not let me enter a password; it kept losing focus.

I tried the update again, but it encountered an issue, which I don’t recall now. I have done a further re-install and am not using Chrome. Things seem ok so far.

Sounds like a graphics issue

Do your devices support the minimum version of ngl GSK requires? I still get crashes with "cairo", but far fewer.

Hopefully someone else has a full fix that doesn’t reduce gfx performance further?

I also use environment.sessionVariables but don’t think that matters.

1 Like

According to Gtk – 4.0: Running and debugging GTK Applications “ngl” isn’t a valid option for that env var

1 Like

Strange - as that was added to address this issue.

I tried adding the GSK_RENDERER variable (both ngl and opengl) but that didn’t help, Chrome still locks up the machine after opening it a few times at most

Tried new NixOS version on the PCs at Code Club - no issues there, phew.

I’m having the same problem. Does anyone have more information?
I’m guessing it mainly affects older graphics cards.

Can you share the logs of journalctl? It might provide some more information. A few weeks ago I had a very similar issue with Firefox — turns out there had been a regression in some AMD drivers. Restoring the older NixOS build fixed it until the problem was (swiftly) fixed upstream.

I’m wondering if adding NVIDIA firmware could fix my freezes.

I found a reported solution for Linux mint:

mkdir /tmp/nouveau && cd /tmp/nouveau
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/340.108/NVIDIA-Linux-x86_64-340.108.run
sh NVIDIA-Linux-x86_64-340.108.run --extract-only
wget https://raw.github.com/envytools/firmware/master/extract_firmware.py
python3 extract_firmware.py

Is simple enough, but have spent ages trying to work out how to do the equivalent of

sudo mkdir /lib/firmware/nouveau && sudo cp -d nv* vuc-* /lib/firmware/nouveau/

in NixOS with no success.

Finally got it working :tada:

  ...
  hardware.firmware = [
    (pkgs.runCommand "fw-nvidia" { 
      nvFw = ./nvidia;
    } ''
      mkdir -p $out/lib/firmware/nouveau
      cp -r "$nvFw"/* $out/lib/firmware/nouveau/
    '')
  ];
  ...

(the files show up in /run/current-system/firmware/nouveau)
Hopefully it will help.