KDE Plasma 6 - Lagging unless Steam is open?

Hey! Recently I’ve installed two more JDKs so i could use them for Minecraft and such, in hindsight I probably should’ve just downloaded them outside of my configuration.nix, but here we are.

For whatever reason, my desktop environment will horribly lag from startup until either

  1. Steam opens.
  2. I open YouTube on Firefox.

directly after I installed the JDKs I didn’t notice the problem because I had already opened steam and I ran

sudo nix-collect-garbage --delete-old

so any rollback ideas are out the window, but I’ve since commented out the added JDKs and rebuilt but the problem still remains somehow.

What am I missing here?

Here’s the packages I’m using:

# Regular Programs.
discord
vesktop
vscode-fhs
freecad #rev 10 2-7-25
openrgb
eclipses.eclipse-java
libreoffice
vlc
anydesk
easyeffects
godot_4-mono

# Java.
jdk21_headless
#jdk17 # These seem to conflict with jdk21
#jdk8

# Other stuff
sdkmanager
bash
neofetch
git
wget
wineWowPackages.waylandFull
helvum

# GPU Drivers
mesa

Another thing to note: I’m not 100% sure the problem started with installing Java 8 and 17, just ~80% sure.

Just remembered that the other thing I changed during that generation was adding “sdkmanager” to my pkgs, so I commented that out and tried again, still no luck.

Now I’m just gonna comment out all my pkgs except my drivers, rebuild and reboot, and juuuust verify this isn’t something weird lol.

Edit: It fixed nothing? Also I managed to snap a pic of what I thought looked like errors, reading:

[ 7.671766] amdgpu 0000:03:00.0: [drm] *ERROR* dc_dmub_srv_log_diagnostic_data: DMCUB error – collecting diagnostic data

and then that repeats itself 24 total times but with different numbers in the brackets, the largest one being [ 11.659681].

ooh, this one’s easy! dont mind if i yoink the easy answer…

so, the problem is… pkgs.mesa - youre not supposed to install it as a literal package in environment.systemPackages, you silly, there is an option for it, which installs and configures all kinds of drivers (and firmware) for you:

  hardware.graphics = {
    enable = true; # installs 'pkgs.mesa'
    enable32Bit = true; # installs 'pkgs.pkgsi686Linux.mesa'
  # and more!
  };

the packages that this option installs are the ones that STEAM installs and uses, but once you are outside of steam, there are no real drivers - i suppose.

so, to get those drivers system-wide is pretty easy to do, if you only have an AMD CPU and GPU, that is… in most cases, that’s it, you don’t really need anything else, just hardware.graphics.enable - for intel, AMD and NVIDIA. CLARIFICATION: use the method ABOVE!

but there’s things like:

  boot.kernelModules = [ "amdgpu" ]; 

or

  hardware.amdgpu = {
    amdvlk.enable = true;
    amdvlk.support32Bit.enable = true;
    opencl.enable = true;
    # and more!
  };

(modern GPU’s only!)

and so on and so forth. it gets pretty complicated. you SHOULD REALLY search all these options up with this tool right here!

as for anything NVIDIA… sorry, dont own one, im gonna pass this to someone else…

I’m using both an AMD CPU (Ryzen 5 7600) and GPU (RX 9070) (which I just upgraded to from an RX 6650 XT :3).

I really hope the fix is actually just that simple! How can you tell when something is meant to be a n option and not just a package btw? Seems like an evidently important skill lol

1 Like

oh, i had the same question for months. until someone replied with a “welp, all you can do is pretty much just to manually type keywords in”. and yeah, i had a bad habit of downloading stuff as packages, when i realised that 50% of the things i have, got an option as a better alternative. and i mean like proper BUNDLES of preconfigured stuff. so, for example, if you install a pkgs.gnome-desktop, youre probably not gonna get even a working session. you will have to go to that search engine page and just type in “gnome”, and usually that is enough to get what you need, but you can be a bit more specific like “gnome desktop”, and then you will see a services.desktopManager.gnome.enable, where .enable is usually the option that installs lots of things and packages, that you can also exclude and configure, and stuff, but by looking up what’s services.desktopManager.gnome. is (tip: leave a dot “.” at the end for a more natural sorting), you can see that there’s even more stuff, but this was just an example. this way, you can install pkgs.steam and other stuff, like servers, firewall, gamescope, udev rules, joystick support, blah blah blah, IN ONE LINE as an option, which doesnt come as a pkgs.steam package, besides, that package is just a bunch of libraries and not even the client. you know what i mean? its really hard to explain, but… BASICALLY look an option up FIRST, if there are no results (cos theres no need or ppl are lazy), then the package.

that said, i have a filthy config that i use for multimedia (and production!) AND gaming. 10k lines in one configuration.nix, it has stuff commented out everywhere for all occasions, even though i am not really planning on publishing this anywhere… i still have ~1200 lines of packages and the rest are options, its utterly unreadable and i love it, and if it sounds a lot, well, thats just 1% of the nixpkgs, so no, thats not much, you know! i had to manually, one by one, sweep through each and every package to look up their option, if there is one. you dont wanna do that, so get yourself a habit of looking up OPTIONS first, alright?

also, in case you got a black screen after rebooting… nixOS is a distro that has rollbacks by default. not of filesystems, but of configs (which is better!), so check your bootloader :stuck_out_tongue:

1 Like

Well I found the problem!

Your thing was probably also required, but I think the more pressing issue was some stuff left over from when I was using a flake to get mesa 25 before the stable version was out, (I needed mesa25 because the RX 9070 requires it lol), so I was running two conflicting drivers kinda maybe I think?

Thank you!!!

1 Like