Trouble with suspend/resume on a Thinkpad x395 (Ryzen 7 PRO 3700U)

rtl8192eu line was just an example of how to add drivers. Its specifically for realtek wireless so not relevant to you.

That might do it. I just now updated the BIOS, and so will let you know what happens in a few days.

For the record, though their BIOS app is “for windows” or whatever, it’s an ISO that boots off of a USB drive and is completely platform independent. With lots of scary verbiage about “full battery”, “on AC power” and “the main board may have to be replaced” if the process is interrupted…

1 Like

So, while it is still not 100% reliable, I feel like updating the bios (from an August version to the October 30th version) helped a little, and then setting acpi_osi=Linux on the kernel command line helped a bit more.

“white screen” in particular turns out to be an artifact of screen locking with i3lock, which turns the screen solid white. acpi_osi=Linux broke my screen locking, and I’ve now seen the system lock with just a snapshot of what was on my screen when it locked.

It’s good enough to make the machine usable now. I just have to work on screen locking and the myriad wireless issues.

1 Like

Well, it’s been 9 days. Averaging everything out, any time I close my laptop is about a 50% chance of a hard crash. Either it will fail to sleep or it will fail to wake up.

I’ll get stretches of a day or so when the machine reliably goes to sleep every time I close it, and then stretches of a day in which it crashes every single time.

1 Like

Every time I put my NixOS laptop to sleep it is ~70% chance it won’t wake up if I’m out and about. If I’m at work and the laptop is docked it is about 100% chance it will properly wake up.

Sometimes I wonder how I got to the point of accepting this as normal… :man_shrugging:

2 Likes

Someone had a similar problem here: Laptop suspend fails. Might be of some use.

Not the same machine that I have, but I’ve updated fwupd and will see if that does anything. I don’t think it downloaded any updates, though.

My E585 was having similar problems and I tried updating the BIOS and that didn’t help. Then I tried switching from Linux kernal latest to the normal Linux kernel in nixpkgs and it got a lot better. I’ll try to send you the kernel I’m on later.

I’m starting to think the problem is a GPU problem.

Flimsy evidence here, but every now and then when I boot the machine (which I have To. Do. So. Often.) X just fails to start and the machine actually hangs. No response to ctrl-alt-f1, ctrl-f1, no response to the power switch, etc.

Additionally, I’ve installed leela-zero on my machine, which makes heavy use of the GPU, and the app crashes while searching for the GPU. Works fine (but slowly) if I tell it to use only the CPU. The error message looks like this:

BLAS Core: built-in Eigen 3.3.7 library.
Detecting residual layers...v1...256 channels...40 blocks.
Initializing OpenCL (autodetecting precision).
OpenCL: clGetPlatformIDs
terminate called after throwing an instance of 'cl::Error'
  what():  clGetPlatformIDs
Aborted (core dumped)

(I think this is GPU-related because of this, but I could be wildly wrong)

So, maybe the AMDGPU module is broken? But I also don’t know how to reconfigure X to start if I disable the driver, so I’ve made no real progress on that.

Other than that, the machine is fine. Definitely a powerhouse, compiles code quickly, links GTK libraries about as slowly as I think anything else would link GTK libraries, and performs fairly well when I’m doing photo editing on 6000x4000 photos.

My kernel version is 4.19.84 and I haven’t had any problems with my laptop waking up.

Would you be willing to post the relevant section of your configuration.nix?

I ask because when I look at my nixpkgs I’m only seeing sections like pkgs.linuxPackages_4_14 and pkgs.linuxPackages_4_9. A few others, too, but nothing even close to the 4.19 series.

I don’t think we ever did.

What I think we accepted as normal is that we have very little power to change things like this, and that consumer hardware vendors don’t really much care about Linux users.

I don’t think there is anything specific in my configuration that sets that. I’m using the default linux kernel via nixpkgs commit 19b9dd603a2. (I build my systems based on whatever nixpkgs master I pull when I want to update something.)

Unfortunately, no good. Not only will X not start, but the system froze the first time it went to sleep.

Fingers crossed for the new 5.4 kernels…

Unfortunately, no good. Not only will X not start, but the system froze the first time it went to sleep.

Fingers crossed for the new 5.4 kernels…

No idea how similar are BIOS/ACPI problems for various Thinkpads…

Observations on W530:

  1. Standby with AC unplugged does seem to hang less often
  2. It still hangs sometimes
  3. Including with 5.4…

I have a Lenovo T495, and it’s the exact same CPU. I had the same issue (even with the latest 5.4 kernel built manually).

Do you use a WM/DE built upon Xorg or Wayland ? When I switched from Xorg to Wayland (i3 to sway) it started to work smoothly : no more issue with sleep.

Today, if I put to sleep while being on a Xorg dummy session (with xterm only to type systemctl suspend) I reproduce the issue most of the time. On Wayland I cannot reproduce the issue, and it works pretty well.

Do you use a WM/DE built upon Xorg or Wayland ? When I switched from Xorg to Wayland (i3 to sway) it started to work smoothly : no more issue with sleep.

Today, if I put to sleep while being on a Xorg dummy session (with xterm only to type systemctl suspend) I reproduce the issue most of the time. On Wayland I cannot reproduce the issue, and it works pretty well.

Hm, good question; I alternate between running Xorg and just an fbterm, the last hang was with a text VT in the foreground and VT7 with Xorg in the background, and I don’t remember whether the previous one was with Xorg in foreground or from fbterm with no Xorg. Will try to experiment with that, thanks.

Are you guys using kde plasma by any chance or possibly something with heavy desktop effects ?
I had the similar issue on a ryzen 7 3700u laptop, where sleep would hard fail and temp bricked the laptop requiring a hard power cycle but after doing a bit of debugging I ended up disabling the plasma compositor (and now have no fancy desktop effects) but sleep works fine. Good luck !

I was not using Plasma back then, I was using i3 without any compositor main of the time (and for my reproduction setup I’m literally using a barebones X with only xterm). So I do not think this is related to heavy compositors. (When I needed composition on xorg, I was using compton, and I was still experiencing this issue). If this is indeed related to xorg, I believe a compositor can make the effect worse. (If you are experiencing a 50/50 chance to recover from sleep, you could be at 80/20 for instance).

Another thing to check : are you using the “full” amdgpu driver for Xorg or are you using Xorg with KMS ? (One way to know is to check if vaapi is enabled correctly using vainfo command : if you do not have vaapi, you might be using KMS).

I’m pretty sure i’m using the open source drivers, unless official drivers are now shipped and used by default. I’m also not forcing nomodeset so i reckon kms is used by default.