# Can not suspend system - automatically wake up.



## T0maas (Dec 11, 2021)

Hello, I can't suspend my system, respectively it goes to suspended state but after very short time (around 1sec) it automatically wakes up and only black screen is shown and I must do full restart (ctrl+alt+delete) because system is unusable in this state. 
I'm using KDE5 plasma desktop with sddm, my GPU is nvidia gtx 1060, legacy bios (not using uefi).


----------



## drr (Dec 13, 2021)

Hope you have already been through the Handbook; specifically, section 12.13. Power and Resource Management. Do you have any attached peripherals, which could be causing the system to wake up? I have faced that issue once with a wireless mouse.


----------



## T0maas (Dec 15, 2021)

Yes I have USB mouse. But I dont have problems on linux, only freebsd has this issue.


----------



## SirDice (Dec 16, 2021)

Odd question perhaps, but what happens if your shutdown the machine (`shutdown -p now`)? Does it power back on after a couple of seconds too?


----------



## kpedersen (Dec 16, 2021)

T0maas said:


> I must do full restart (ctrl+alt+delete) because system is unusable in this state.


If you use ctrl-alt-F1, ctrl-alt-F2, etc Do you get an image back? Something isn't quite right but perhaps you can avoid the restart just switching vt.


----------



## T0maas (Dec 20, 2021)

kpedersen said:


> If you use ctrl-alt-F1, ctrl-alt-F2, etc Do you get an image back? Something isn't quite right but perhaps you can avoid the restart just switching vt.


If I press ctrl-alt-F2 after automatic wakeup from sleep I got this strange screen.


----------



## T0maas (Dec 20, 2021)

SirDice said:


> Odd question perhaps, but what happens if your shutdown the machine (`shutdown -p now`)? Does it power back on after a couple of seconds too?


This works normally, does not power back, stays powered off. But during shutdown I see that strange screen I posted before.


----------



## grahamperrin@ (Dec 22, 2021)

The problem after wake should be easier to explain (and hopefully resolve).

Maybe focus first on the *unexpected wake*, which is extraordinary, although I might have seen someone else reporting the same symptom a few weeks ago.

Knowing as much as possible about the hardware, and software, will help. Swiftest, if you're happy to share, will be the result of a hardware probe. Run these two commands as root (the first is a one-off):

`pkg install sysutils/hw-probe sysutils/hwstat sysutils/lsblk sysutils/pciutils sysutils/usbutils`
`hw-probe -all -upload`
Is the computer docked? If so, please describe the dock – make and model.




> someone else reporting the same symptom a few weeks ago.



Ignore that. I was mistaken, thinking of <https://forums.freebsd.org/posts/541578> where there's unexpected _sleep_.


----------



## T0maas (Dec 26, 2021)

I've tried `hw-probe -all -upload` here is the result: https://bsd-hardware.info/?probe=62f424cac5.



grahamperrin said:


> Is the computer docked?


What do you mean docked? It is standard PC in chassis.


----------



## grahamperrin@ (Dec 26, 2021)

T0maas said:


> … PC in chassis.



Thanks. 


Types of docks vary, <https://forums.freebsd.org/threads/82360/> mentions the type that I currently use. As your computer is not a notebook, please ignore the question.


----------



## grahamperrin@ (Dec 27, 2021)

<https://bsd-hardware.info/?probe=62f424cac5&log=uname>

I reckon, update the system, and packages, before anything else. 

Then <https://bsd-hardware.info/?probe=62f424cac5&log=lsusb> try disconnecting all USB peripherals, except the keyboard, before sleep/suspend.


----------



## T0maas (Feb 21, 2022)

Sorry for late posting, I solved 1st problem: automatic wakeup by disconnecting all USB devices.
But there is second problem: When I wake up system by pressing power button system freeze and only black screen is shown and keyboard does not react, not even numclock flashes keboard's LED, hard reset needed.


----------



## grahamperrin@ (Feb 21, 2022)

T0maas said:


> … When I wake up system by pressing power button system freeze and only black screen is shown and keyboard does not react, not even numclock flashes keyboard's LED, hard reset needed.



Maybe an issue with the NVIDIA driver.

`sysrc -f /etc/rc.conf kld_list`

I guess that `nvidia-modeset` is amongst the listed modules, true?

<https://forums.freebsd.org/posts/551939> includes a highlighted view of *the package message*.


----------



## skunk (Feb 21, 2022)

The issue is easy to fix. You must do two things:
1. vt newcons breaks suspend/resume for all graphics cards that do not use KMS drivers. So you must use the sc console for that. This only works on non-UEFI systems, though.
2. You need to build a new kernel with "nooptions VESA" for having resume work with Nvidia driver, if you do not use -CURRENT.

If you insist in using vt instead of sc console, then the only way to to be able to use the console/to avoid the colored box pattern, is to use vt newcons in text mode. But this does not work on UEFI systems and does not solve the suspend/resume fail issue.


----------



## grahamperrin@ (Feb 22, 2022)

skunk thank you! (I should have remembered 253733.)

Welcome to FreeBSD Forums. I'm very pleased to see what's in your signature, promoted …


----------



## T0maas (Mar 2, 2022)

grahamperrin said:


> Maybe an issue with the NVIDIA driver.
> 
> `sysrc -f /etc/rc.conf kld_list`
> 
> ...


I tried that but:

```
sysrc -f /etc/rc.conf kld_list
sysrc: unknown variable 'kld_list'
```
But if you are talking about modules I have them listed in /boot/loader.conf:

```
kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
cryptodev_load="YES"
zfs_load="YES"
hw.usb.no_boot_wait=1
nvidia-modeset_load="YES"
kern.vty=vt
machdep.disable_mtrrs="1"
cpu_microcode_load="YES"
cpu_microcode_name="/boot/firmware/intel-ucode.bin"
```
Yes there is nvidia-modeset, but just nvidia did not work (only black screen with cursor, console not xorg)


----------

