tpwrules / nixos-apple-silicon

Resources to install NixOS bare metal on Apple Silicon Macs
MIT License
748 stars 74 forks source link

Xorg with Nixos on an M1 macbook air seems to be very sluggish. #83

Closed x0ba closed 11 months ago

x0ba commented 1 year ago

I wrote up a basic home-manager + nix flake config for my m1 mac, and i'm using the same awesomewm config as what i used on regular asahi alarm. however, awesome on Nixos is noticeably slower, with workspace switching taking upwards of 1 second and the CPU usage of X spiking up to 50% every time a window is opened. Programs that used to work perfectly in asahi alarm, such as alacritty, now cant seem to use the graphics driver as they run very slowly. I have opengl and the edge kernel enabled, the relevant part of the config here

I would really appreciate if someone could tell me exactly what I'm doing wrong,

psanford commented 1 year ago

I don't see hardware.asahi.useExperimentalGPUDriver = true; set in your config.

psanford commented 1 year ago

If you run glxinfo you can see the current driver being used. llvmpipe is the cpu renderer. Apple ... will be the gpu:

# cpu renderer
$ glxinfo  | grep 'OpenGL renderer string'
OpenGL renderer string: llvmpipe (LLVM 15.0.6, 128 bits)

# gpu renderer
$ glxinfo  | grep 'OpenGL renderer string'
OpenGL renderer string: Apple M2 (G14G B0)
shayne commented 11 months ago

I use none+i3 and have a pretty sluggish experience. However, Firefox has proper GL acceleration (tested via WebGL). I reconfigured things to use a proper DE, which was smooth. I haven't spent the time to figure out what's going on with i3.