Hi, I’m relatively to Nix and setting up a Lenovo X1 Carbon Gen 9.
I’d really appreciate help setting up the graphical side of things. With my current setup, I experience a lot of screen tearing. At least, that’s what I think it is. When switching from one program to another (e.g. alacritty to firefox), some portion of the screen will remain unchanged. Sometimes this is brief, and other times, I have to move the mouse for the screen to completely refresh.
This is really a very similarly motivated post, just for Intel Mesa rather than Nvidia.
I tried following the configuration steps in the NixOS manual. I also tried the configuration suggested there for troubleshooting screen tearing, but that actually made things worse.
Some relevant information:
Graphics: Mesa Intel Xe Graphics (TGL GT2)
Display: 14" 16:10 2840 x 2400
/etc/nixos/configuration.nix (the relevant parts):
Hey! I’m afraid I don’t have any good tips for you with this setup, but I appreciate the mention I’ve also got a Yoga on the way which should roughly match your specs, so I’ll be watching this thread with a lot of interest.
Finally, as someone told me in my thread: thanks for providing all the info! It makes it much easier to help you debug the issue. Hopefully someone with more experience with your Mesa systems will drop by and be able to help you out.
Just had a quick look at the docs you linked, so I’m sure you’ve covered it already, but have you tried setting
I’ve your same laptop but I never experienced your issues, I’ve switched to wayland since a month and before I’ve never used full desktop environments like you. Anyway, I think that I’m using a much recent kernel release, the 2.13.12, as of now. For that, I’ve this line in my config:
boot.kernelPackages = pkgs.linuxPackages_latest;
You can find more of my config here, look for the config of the bean host.
Oh, yeah, sorry. I should have re-read the opening post better; you already said so Sorry, my bad! But yeah, in that case, I don’t have many other suggestions for now.
Thanks @azazel75 - your configuration looks a lot more mature than mine. I’m just getting started with NixOS, so I’m not sure I understand all the layers involved.
I did adopt your kernel release suggestion, but that didn’t seem to resolve the issue.
I’m wondering if the problem is related to the fact that I have a 4K screen. Do you have that on your machine?
Edit: Oh, one other thing…are you using sway with Wayland or some other window manager? Thanks!
Still no solution, but here’s an update on what I’ve tried.
I set services.xserver.displayManager.gdm.wayland to false to force the use of X11 and then tried the manual’s suggestion of using intel, DRI2, TearFree, etc. That made things much worse with all sorts of visual artifacts and very slow graphics performance (basically unusable).
Oh, bummer! the other things i do usually is to update all the firmwares using fwupdmgr utility and pay attention to install all the updated in the “lenovo thinkvantage” utility in windows… some are the same that fwupdmgr would install but some don’t.
I’ve a 5K 34" LG connected to it.
Yes, you can see its configuration in the module azazel/wayland.nix inside my repository. I must say that this may not be a good moment to switch to sway on unstable because one its main dependencies, wlroots, seems to be undergoing some major refactorings and this seems to be the root of some instabilities and issues with some apps, like firefox.
One other thing that comes to mind: are you connecting the display directly via HDMI or USB-C or are you using some dongle or other devices that does some conversion maybe? In such case that may be the culprit? (I’m connecting the display directly via USB-C-Thunderbolt)
Didn’t know about this - thanks! I’m not dual-booting, so I don’t have access to the “lenovo thinkvantage” utility, but I didn’t know about fwupdmgr at all.
I’m just using the built-in screen, which is 14" 3840 x 2400.
Re: sway
Thanks! It’s too bad that there’s some instability right now, but I might try it anyway.
Modern gnome uses wayland by default. This is probably a good thing, once you figure out screen sharing, which IME is the main snag.
This might be considered a bug, since you use services.xserver, so you’d think it would launch an X server for your user, but gdm is what handles your actual user session. That is, I think currently you’re starting gdm in an X server, which then launches wayland.
As for your remaining “screen tearing” - no idea. I think that’s more likely to be a wayland/gnome bug than driver related, but others are more qualified to answer that.
Whoops, discourse seens to have loaded a cached copy or something, didn’t see the other replies until just now, sorry!
Just as a quick experiment, I turned off X11 + Gnome, copied the suggested configuration details for sway from the NixOS wiki page, rebuilt, and rebooted. I now have a host of new tools to configure, but I’m no longer seeing any graphics artifacts
My best guess is that the artifacts I was seeing came from Gnome, though I’m not entirely sure why.
I believe that this is specific to this particular iGPU (it’s also documented on the Arch Wiki for my laptop: Dell XPS 13 (9310) - ArchWiki). But even with PSR turned off I didn’t witness any noticeable increase in power draw, so I think the returns of this feature are diminishing and if it causes issues is safe to turn off.
Just wanted to chime in after getting my gen 6 X1 Yoga (which is essentially the same as the Carbon, just foldable)
I use X and EXWM and I had screen tearing with the default settings. However, switching to using the latest kernel packages and using the secondary option (intel video driver) seems to have fixed it. The docs mention that this may cause some performance issues, but I don’t think that’s going to cause much of an issue. At least I hope not.
I do have a follow-up question, though: could the screen tearing that appears with the modesetting option be fixed by a late set of kernel packages? That is, if I switch back to using modesetting, could it one day magically be fixed by updating the system?