Suspend-to-RAM (sleep) reddit / freebsd ---------------------------------------------------------------------- bileslav · 2023-12-24 00:55 ​ |Mobo|ASRock B550 PG Velocita| |:-|:-| |CPU|AMD Ryzen 9 5900X| |GPU 1|KFA2 GeForce RTX 3080| |GPU 2|AMD Radeon RX 560| Both GPUs are connected to my monitor. AMD is used for FreeBSD 14.0-RELEASE host graphics ([river](https://github.com/riverwm/river)). NVIDIA is used for bhyve VMs' graphics (pptdevs). I use [sysutils/vm- bhyve](https://www.freshports.org/sysutils/vm-bhyve). At the moment, I only have 1 VM, which is also FreeBSD, with [graphics/nvidia-drm- kmod](https://www.freshports.org/graphics/nvidia-drm-kmod), which autostarts with the host so that the GPU coolers don't spin for no purpose and all that. Everything here works good, except for a few things: I haven't figured out yet why Linux guests' drivers can't initialize the GPU; Windows 11 cannot yet use more than 1 vCPU when passing PCI ([bhyve bug](https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268794)). In short, Windows 10 and FreeBSD guests seem to work great with the passed NVIDIA GPU. Rebooting VMs works correctly, the GPU doesn't break after that (no need to reboot the host). By the way, the working GPU passthrough is very cool. I'm thinking about making a video or something about this so that more people will know that it works on FreeBSD **today**. I just need a bit more experience and confidence. Now I'm thinking about the subject. I've heard that there are problems with this on FreeBSD, and I can confirm that. My observations regarding `zzz`: 1. Sometimes the system goes to sleep and wakes up without visible issues, but after 10–15 seconds it just reboots. I have 1 dump in `/var/crash/` that may be related to that case, I'm not sure if it happened that day. If so, the backtrace indicates a connection with ZFS. I'll file a bug report on that separately. I also have 2 core dumps from crashes when using GIMP. 2. Sometimes the system goes to sleep and wakes up without visible issues, but the guest OS completely loses the passed GPU (DRM errors, I don't have their text at hand, but I can get it) until the host is rebooted. This happens in any case. I thought about stopping the VM that controls the GPU before doing `zzz`, but didn't try more than once because of the next occasion: 3. Sometimes the system doesn't go to sleep as a whole. The NVIDIA GPU sometimes doesn't go to sleep, as can be seen from its coolers and LEDs. Then, after a few seconds, the computer reboots. No new stuff appears in `/var/crash/`. 4. About a month ago, after waking up, problems were also observed with amdgpu/drm-kmod (Wayland crashed), but I no longer observe this. I don't think this is an exhaustive list. It's obvious that the behavior is extremely unstable. I feel this information might be useful for the developers, but I don't know where it would be more appropriate to report it. Any thoughts on the topic? I'm just new here, switching from Linux. Would it make sense to also post this on the forum for greater coverage? In general, I think that it's quite possible or even beneficial to live without this feature. At least in my setup. I used to use it because I periodically have to get up from the PC for a while, and it was awkward to leave everything working, but I don't want to turn things off completely. I think it'll be enough to set up the graphical environment so that the display goes off on idle. Suspend on Linux also sometimes brought up unpleasant incidents. I think not using suspend means having a more stable system, and a UPS is nice to have anyway. ---------------------------------------------------------------------- m15f1t · 2023-12-24 09:33 I've had so many issues with Suspend-to-RAM in the past with my home nas, it's all so hardware dependent, and it's just not a big focus point for FreeBSD if you ask me. ---------------------------------------------------------------------- bileslav · 2023-12-25 20:31 Fair enough, thanks for your comment. ---------------------------------------------------------------------- grahamperrin · 2023-12-26 16:35 Does [graphics/drm-510-kmod](https://www.freshports.org/graphics/drm- 510-kmod/) support the two AMD GPUs? ---------------------------------------------------------------------- mirror176 · 2023-12-27 01:19 First GPU is NVIDIA. I recently started trying to learn how to read AMD compatibility and presume 2nd I assume gets support from some Polaris firmware though techpowerup lists it specifically as Polaris21 which I don't see a specific firmware file for that at https://github.com/freebsd/drm-kmod-firmware/tree/master/amdgpukmsfw. Really wish I understood how to look up the general supported list so version compatibility could be better determined even if it isn't the most bug-free listing. ---------------------------------------------------------------------- bileslav · 2023-12-27 05:25 Thanks for your clarification. AFAIU, that's `polaris11`: # dmesg | egrep 'amdgpu|firmware' [drm] amdgpu kernel modesetting enabled. amdgpu: ATOM BIOS: 115-C994PI0-102 drmn0: successfully loaded firmware image 'amdgpu/polaris11_k_mc.bin' [drm] amdgpu: 2048M of VRAM memory ready [drm] amdgpu: 3072M of GTT memory ready. drmn0: successfully loaded firmware image 'amdgpu/polaris11_pfp_2.bin' drmn0: successfully loaded firmware image 'amdgpu/polaris11_me_2.bin' drmn0: successfully loaded firmware image 'amdgpu/polaris11_ce_2.bin' drmn0: successfully loaded firmware image 'amdgpu/polaris11_rlc.bin' drmn0: successfully loaded firmware image 'amdgpu/polaris11_mec_2.bin' drmn0: successfully loaded firmware image 'amdgpu/polaris11_mec2_2.bin' drmn0: successfully loaded firmware image 'amdgpu/polaris11_sdma.bin' drmn0: successfully loaded firmware image 'amdgpu/polaris11_sdma1.bin' amdgpu: hwmgr_sw_init smu backed is polaris10_smu drmn0: successfully loaded firmware image 'amdgpu/polaris11_uvd.bin' [drm] Found UVD firmware Version: 1.130 Family ID: 16 drmn0: successfully loaded firmware image 'amdgpu/polaris11_vce.bin' [drm] Found VCE firmware Version: 53.26 Binary ID: 3 drmn0: successfully loaded firmware image 'amdgpu/polaris11_k_smc.bin' [drm] Initialized amdgpu 3.42.0 20150101 for drmn0 on minor 0 [drm] amdgpu kernel modesetting enabled. amdgpu: ATOM BIOS: 115-C994PI0-102 drmn0: successfully loaded firmware image 'amdgpu/polaris11_k_mc.bin' [drm] amdgpu: 2048M of VRAM memory ready [drm] amdgpu: 3072M of GTT memory ready. drmn0: successfully loaded firmware image 'amdgpu/polaris11_pfp_2.bin' drmn0: successfully loaded firmware image 'amdgpu/polaris11_me_2.bin' drmn0: successfully loaded firmware image 'amdgpu/polaris11_ce_2.bin' drmn0: successfully loaded firmware image 'amdgpu/polaris11_rlc.bin' drmn0: successfully loaded firmware image 'amdgpu/polaris11_mec_2.bin' drmn0: successfully loaded firmware image 'amdgpu/polaris11_mec2_2.bin' drmn0: successfully loaded firmware image 'amdgpu/polaris11_sdma.bin' drmn0: successfully loaded firmware image 'amdgpu/polaris11_sdma1.bin' amdgpu: hwmgr_sw_init smu backed is polaris10_smu drmn0: successfully loaded firmware image 'amdgpu/polaris11_uvd.bin' [drm] Found UVD firmware Version: 1.130 Family ID: 16 drmn0: successfully loaded firmware image 'amdgpu/polaris11_vce.bin' [drm] Found VCE firmware Version: 53.26 Binary ID: 3 drmn0: successfully loaded firmware image 'amdgpu/polaris11_k_smc.bin' [drm] Initialized amdgpu 3.42.0 20150101 for drmn0 on minor 0 ---------------------------------------------------------------------- mirror176 · 2023-12-27 08:41 510 and 515 branches should both have support as best as I can tell trying to follow repository changes; looks like the card was added before 5.9. My understanding is regressions are sometimes a thing so would be wise to try with each and I know grahamperrin has been seen more than once with posts about 515 having issues not found in 510. I do not know if it will help as I have little modern GPU+FreeBSD experience and normally only use sleep if on a laptop with osx/windows as it has been unreliable when I tried on freebsd, linux, and desktops. ---------------------------------------------------------------------- grahamperrin · 2023-12-27 17:00 If drm-510-kmod does support *both* AMD cards, then (yes) it'll be worth trying it (as an alternative to drm-515-kmod and meta port drm- kmod). ---------------------------------------------------------------------- bileslav · 2023-12-27 22:26 Please correct me if there's any misunderstanding. I have only one AMD GPU, in the 2nd slot. The 1st slot contains NVIDIA. But the essence of the post is generally a little different than just drm-kmods. ---------------------------------------------------------------------- grahamperrin · 2023-12-28 02:45 > I have only one AMD GPU, in the 2nd slot. Sorry! I misread the opening post, I misread CPU as GPU (partly because I saw AMD next to it, and AMD code names mean nothing to me).