Mysteriously bad X performance

Hi! :wave:

Just getting started with NixOS, attempting to move from Manjaro (still have both installed).

For some reason my X server process on NixOS is oscillating between 40-100+%, especially when moving windows around with the mouse-cursor and it’s very choppy. Keyboard is very unresponsive. On Manjaro X doesn’t really show up in htop and it’s not at all sluggish.

Tried running teapot from mesa-demos and it claims that the frame rate is around 50, but experienced rate is 1-2. Maybe there’s something wrong with the (Nvidia) GPU → Screen communication… or GPU → X.

Not very used to diagnosing performance issues on Linux (mostly Windows dev background). If someone has any ideas for what to check I would really appreciate it. Below follows output from inxi, maybe something pops out for someone? I tried posting X org logs but exceeded the allowed post size, uploaded them here:

https://digitalpoetry.se/Xorg.manjaro.log

https://digitalpoetry.se/Xorg.nixos.log

NixOS inxi -F output

System:    Host: nixos Kernel: 5.15.94 x86_64 bits: 64 Desktop: Xfce 4.16.1 Distro: NixOS 22.11 (Raccoon) 
Machine:   Type: Desktop System: Compulab product: Airtop3 v: N/A serial: <superuser required> 
           Mobo: Compulab model: SBC-ATCFL v: 1.2 serial: <superuser required> UEFI: American Megatrends v: ATOP3.PRD.0.30.4 
           date: 02/11/2020 
CPU:       Info: 8-Core model: Intel Xeon E-2288G bits: 64 type: MT MCP cache: L2: 16 MiB 
           Speed: 4960 MHz min/max: 800/5000 MHz Core speeds (MHz): 1: 4960 2: 4901 3: 4961 4: 4920 5: 4900 6: 4901 7: 4958 
           8: 4954 9: 4902 10: 4900 11: 4901 12: 4901 13: 4901 14: 4901 15: 4901 16: 4902 
Graphics:  Device-1: NVIDIA TU116 [GeForce GTX 1660 Ti] driver: nvidia v: 520.56.06 
           Display: x11 server: X.Org 1.20.14 driver: loaded: nvidia note: n/a (using device driver) 
           resolution: 3840x2160~60Hz 
           OpenGL: renderer: NVIDIA GeForce GTX 1660 Ti/PCIe/SSE2 v: 4.6.0 NVIDIA 520.56.06 
Audio:     Device-1: Intel Cannon Lake PCH cAVS driver: sof-audio-pci-intel-cnl 
           Device-2: NVIDIA TU116 High Definition Audio driver: snd_hda_intel 
           Device-3: Kingston HyperX 7.1 Audio type: USB driver: hid-generic,snd-usb-audio,usbhid 
           Sound Server-1: ALSA v: k5.15.94 running: yes 
Network:   Device-1: Intel Ethernet I219-LM driver: e1000e 
           IF: eno1 state: down mac: 00:01:c0:28:43:51 
           Device-2: Intel I210 Gigabit Network driver: igb 
           IF: enp4s0 state: down mac: 00:01:c0:28:43:5a 
           Device-3: Intel Wireless 8260 driver: iwlwifi 
           IF: wlp5s0 state: up mac: 5c:80:b6:a7:24:5c 
Bluetooth: Device-1: Intel Bluetooth wireless interface type: USB driver: btusb 
           Report: rfkill ID: hci0 rfk-id: 1 state: down bt-service: not found rfk-block: hardware: no software: no 
           address: see --recommends 
Drives:    Local Storage: total: 3.64 TiB used: 468.01 GiB (12.6%) 
           ID-1: /dev/nvme0n1 vendor: Samsung model: SSD 980 PRO 2TB size: 1.82 TiB 
           ID-2: /dev/nvme1n1 vendor: Samsung model: SSD 970 EVO 1TB size: 931.51 GiB 
           ID-3: /dev/sda vendor: Crucial model: CT1000MX500SSD1 size: 931.51 GiB 
Partition: ID-1: / size: 391.36 GiB used: 19.36 GiB (4.9%) fs: ext4 dev: /dev/nvme0n1p2 
           ID-2: /boot/efi size: 299.4 MiB used: 89.1 MiB (29.8%) fs: vfat dev: /dev/sda1 
Swap:      Alert: No swap data was found. 
Sensors:   System Temperatures: cpu: 46.0 C mobo: N/A gpu: nvidia temp: 36 C 
           Fan Speeds (RPM): N/A gpu: nvidia fan: 0% 
Info:      Processes: 266 Uptime: N/A Memory: 62.69 GiB used: 1.77 GiB (2.8%) Shell: Bash inxi: 3.3.04 

Any idea where to specify --recommends? I added the optional dependencies from the nix package file for inxi to my configuration.nix but some seem to not have been picked up.

Manjaro inxi -F output

System:
  Host: airtop3 Kernel: 5.15.94-1-MANJARO arch: x86_64 bits: 64
    Desktop: Xfce v: 4.18.1 Distro: Manjaro Linux
Machine:
  Type: Desktop System: Compulab product: Airtop3 v: N/A
    serial: <superuser required>
  Mobo: Compulab model: SBC-ATCFL v: 1.2 serial: <superuser required>
    UEFI: American Megatrends v: ATOP3.PRD.0.30.4 date: 02/11/2020
CPU:
  Info: 8-core model: Intel Xeon E-2288G bits: 64 type: MT MCP cache:
    L2: 2 MiB
  Speed (MHz): avg: 2914 min/max: 800/5000 cores: 1: 1749 2: 1986 3: 4567
    4: 1697 5: 3994 6: 4704 7: 1742 8: 4626 9: 1810 10: 3141 11: 4717 12: 1514
    13: 3167 14: 4125 15: 1577 16: 1512
Graphics:
  Device-1: NVIDIA TU116 [GeForce GTX 1660 Ti] driver: nvidia v: 525.89.02
  Display: x11 server: X.Org v: 21.1.7 driver: X: loaded: nvidia gpu: nvidia
    resolution: 3840x2160~60Hz
  API: OpenGL v: 4.6.0 NVIDIA 525.89.02 renderer: NVIDIA GeForce GTX 1660 Ti/PCIe/SSE2
Audio:
  Device-1: Intel Cannon Lake PCH cAVS driver: sof-audio-pci-intel-cnl
  Device-2: NVIDIA TU116 High Definition Audio driver: snd_hda_intel
  Device-3: Kingston HyperX 7.1 Audio type: USB
    driver: hid-generic,snd-usb-audio,usbhid
  Sound API: ALSA v: k5.15.94-1-MANJARO running: yes
  Sound Server-1: PulseAudio v: 16.1 running: yes
  Sound Server-2: PipeWire v: 0.3.65 running: yes
Network:
  Device-1: Intel Ethernet I219-LM driver: e1000e
  IF: eno1 state: down mac: 00:01:c0:28:43:51
  Device-2: Intel I210 Gigabit Network driver: igb
  IF: enp4s0 state: down mac: 00:01:c0:28:43:5a
  Device-3: Intel Wireless 8260 driver: iwlwifi
  IF: wlp5s0 state: up mac: 5c:80:b6:a7:24:5c
Bluetooth:
  Device-1: Intel Bluetooth wireless interface type: USB driver: btusb
  Report: bt-adapter ID: hci0 rfk-id: 1 state: down
    bt-service: enabled,running rfk-block: hardware: no software: yes
    address: 5C:80:B6:A7:24:60
Drives:
  Local Storage: total: 3.64 TiB used: 1.79 TiB (49.2%)
  ID-1: /dev/nvme0n1 vendor: Samsung model: SSD 980 PRO 2TB size: 1.82 TiB
  ID-2: /dev/nvme1n1 vendor: Samsung model: SSD 970 EVO 1TB size: 931.51 GiB
  ID-3: /dev/sda vendor: Crucial model: CT1000MX500SSD1 size: 931.51 GiB
Partition:
  ID-1: / size: 915.53 GiB used: 448.56 GiB (49.0%) fs: ext4 dev: /dev/sda2
  ID-2: /boot/efi size: 299.4 MiB used: 89.1 MiB (29.8%) fs: vfat
    dev: /dev/sda1
Swap:
  Alert: No swap data was found.
Sensors:
  System Temperatures: cpu: 32.0 C pch: 43.0 C mobo: N/A gpu: nvidia
    temp: 33 C
  Fan Speeds (RPM): N/A gpu: nvidia fan: 0%
Info:
  Processes: 360 Uptime: 1m Memory: 62.68 GiB used: 2.17 GiB (3.5%)
  Shell: Bash inxi: 3.3.25

I booted back into the NixOS installer and realized it was much snappier.

Tried disabling the Nvidia driver in my NixOS installation, which made it switch to the FOSS Nouveau driver instead - same issue with sluggishness. Then tried blacklisting Nouveau → thrown back to console without X on boot (although I can see the X server starting successfully and trying to send a signal somewhere - just not to any of the HDMI ports on my Nvidia GPU and not to my integrated motherboard either).

Will look for the X log file in the installer for clues. Seems to be in a different location.

Realized the installer was running Xwayland and that it was a newer release than the X server. Tried to turn Wayland on for my XFCE environment, but failed, switched to GNOME and Xwayland suddenly activates successfully. So I have to use one of the main 2 desktop environments, I can live with that.

My feedback to the maintainers would be to make services.xserver.desktopManager.xfce.enable = true; fail when simultaneously trying to enable Wayland. Although maybe this will be a non-issue soon enough: https://9to5linux.com/xfce-4-20-desktop-environment-will-finally-bring-wayland-support

1 Like

Thanks for troubleshooting your own issue.

I think the Beauty of nixos, is that you can try all this stuff out, and chop and change without every getting into a situation where it destroys your system.

you may like this talk about fearless tinkering , it’s awesome.

However, you may not.

1 Like

Thanks for the suggestion of that step down the NixOS rabbit hole! Kinda liked it. :slight_smile: