Repository navigation
Description
NVIDIA Open GPU Kernel Modules Version
NVRM version: NVIDIA UNIX Open Kernel Module for x86_64 565.77 srcversion: 0BDAE46B2642DAFAAF16C9C
Please confirm this issue does not happen with the proprietary driver (of the same version). This issue tracker is only for bugs specific to the open kernel driver.
- I confirm that this does not happen with the proprietary driver package.
Operating System and Version
Nixos unstable
Kernel Release
Linux 6.12.6 NixOS SMP PREEMPT_DYNAMIC Thu Dec 19 17:13:24 UTC 2024 x86_64 GNU/Linux
Please confirm you are running a stable release kernel (e.g. not a -rc). We do not accept bug reports for unreleased kernels.
- I am running on a stable kernel release.
Hardware: GPU
GPU 0: NVIDIA GeForce RTX 3080 Ti Laptop GPU
Describe the bug
GPU power state locked in D0 after a monitor has been plugged and unplugged to the gpu.
I am using reverse sync on a advanced optimus laptop, to allow hotplug monitors in the gpu hdmi/dp ports.
After a clean boot, and before plugging an external monitor, the nvidia gpu is in D3cold state.
> cat /sys/class/drm/card*/device/power_state
D0
D3cold
I can power on the nvidia card using nvidia-smi or by running glxinfo, and the power state will switch to D0 before going back to sleep as intented.
The issue arises when a monitor is plugged to the gpu. this will wake the gpu to allow reverse prime to render to the external display.
However, when unplugging the monitor, the power state will never leave D0. (no process running on the gpu)
I found related posts on the nvidia forums,
https://forums.developer.nvidia.com/t/nvidia-dgpu-in-hybrid-optimus-laptop-not-powering-down-after-unplugging-external-monitor/318196
https://forums.developer.nvidia.com/t/565-release-feedback-discussion/310777/154
https://forums.developer.nvidia.com/t/565-release-feedback-discussion/310777/41
and most importantly https://forums.developer.nvidia.com/t/bug-linux-driver-fails-to-remove-framebuffer-device-when-hdmi-cable-plugged-out/316645
In the last one, gm151 noticed that the framebuffer created when plugging the monitor is never cleaned up.
When the cable is plugged in a new framebuffer device is created as it should, however when the cable is plugged out, the device is NOT removed even with no clients using it. This has several negative consequences:
- If the virtual console is remapped to the new framebuffer, then after plugging out, the console is NOT remapped back to the integrated GPU. (This can be inhibited by passing fbcon=map:0, however this does not help the framebuffer to get removed)
- The DGPU device fails to enter D3cold state and consumes power.
Here are some facts from the kernel’s sysfs. Note this is WITHOUT any graphical environment running, pure text console, ruling out the graphical env as a culprit.
Also, a drm journal log was emitted on plug[drm] fb1: nvidia-drmdrmfb frame buffer devicebut nothing on unplug.
I am facing the same situation and did some more testing.
I can indeed see that the frame buffer at /dev/fb1 ( /sys/class/graphics/fb1 ) is created when the monitor is plugged in and not removed on unplug.
Reloading the nvidia-drm module allow to go back in sleep mode:
modprobe -r nvidia-drm && modprobe nvidia-drm
I notice that the ghost framebuffer is removed afterwards, maybe it is what allows RTD3 to kick in.
dumping the framebuffers using cat /sys/kernel/debug/dri/12{8,9}/framebuffer shows that:
-
on fresh boot with d3cold and no monitor, the nvidia related dri framebuffer is empty (empty file)
whereas the other contains a framebuffer allocated byfbcon -
after plugging in a monitor, the nvidia dri framebuffer now contains a framebuffer allocated by fcon too, with a layer size corresponding to the monitor.
-
after unplugging the monitor, the framebuffer does not go back to an empty file, and stays allocated by
fbcon
I tried every combination of kernel parameters / module options to no avail. The more I tried with are:
options nvidia NVreg_EnableGpuFirmware=0 NVreg_DynamicPowerManagementVideoMemoryThreshold=0 NVreg_DynamicPowerManagement=0x02 NVreg_UsePageAttributeTable=1 NVreg_InitializeSystemMemoryAllocations=0 NVreg_PreserveVideoMemoryAllocations=1
options nvidia-drm modeset=1 fbdev=1
I also tried several linux kernel versions.
It seems like the code responsible for fbdev moved recently in the linux kernel and in the oppen-gpu-kernel-modules,
I saw changes related to hotplugs events, so maybe we are missing a handler to cleanup the framebuffers ?
Thanks !
To Reproduce
- on a advanced optimus laptop on hybrid mode
- unplug external monitors
- boot to tty with reverse prime and fine-grained power control enabled
cat /sys/class/drm/card*/device/power_stateto check and wait until gpu is D3coldls /dev/fb*-> should show only the fb0 ( integrated graphics -> internal monitor )nvidia-smi-> boot the gpucat /sys/class/drm/card*/device/power_stateto check and wait until gpu is D3cold- here we know that RTD3 works
- plug an external monitor
cat /sys/class/drm/card*/device/power_stateto check and wait until gpu is D0- here we know the gpu can wake for a monitor
- unplug the external monitor
cat /sys/class/drm/card*/device/power_stateto check and wait until gpu is D3cold <- never happens
Bug Incidence
Always
nvidia-bug-report.log.gz
I have tested 20+ module option combination, which options are the most interesting to generate the report with ?
More Info
No response
Activity
Binary-Eater commentedon Dec 30, 2024
Hi @Aetherall,
We are tracking this in bug 5034343 internally. I am very interested in this issue myself.
My original opinion on this issue is that it should have persisted across various kernel versions, independent of the recent fbdev API refactors.
My expectation is that the hotplug event handler is enumerated by the fbdev core API. I have an explanation of this here.
If you use a LTS kernel like kernel 6.6, are you saying that you do not have this issue? I would be surprised if that was the case.
If so, could you provide two bug collection reports? One with the 6.6 kernel and one with 6.12 kernel using the same driver version.
If you would not mind following up with abchauhan on the NVIDIA forum post, that would be appreciated as well. That way, I can be provided with a repro setup. In theory, I should be able to reproduce this with my work laptop, but it helps us with overall process.
Aetherall commentedon Dec 31, 2024
Hi @Binary-Eater thanks for the followup !
I initially had the issue on LTS kernel, and later upgraded to 6.12 to see if it would fix the issue. I have not reverted back as this kernel version contains other unrelated improvements I want to keep.
I will followup with abchauhan asap and provide the gz logfile and a reproducible environment, however I wont be available for new years eve so it might take few days.
Meanwhile here is my nvidia nixos configuration if you want to reproduce it on the same os as well.
Happy new year !
Kimiblock commentedon Jan 18, 2025
Yeah I'm seeing this on an RTX 4060 mobile. Maybe
nvidia-smi --gpu-resetcan sort of mitigate this problem?Binary-Eater commentedon Jan 25, 2025
To provide a quick update, I believe I have brainstormed a solution to the problem seen here. I have not yet verified it resolves the issue, but theoretically it should enable the GPU to now sleep when all DRM connectors are disconnected due to hotplugs.
HunterWhiteDev commentedon Feb 16, 2025
I am having the same issue. My laptop and linux specs:
dGPU can sleep when I reboot, but when I go from plugged into my monitors, to unplugged, it wont sleep until I restart the laptop
dagbdagb commentedon Feb 19, 2025
Will Ampere GPUs enter RTD3 after a sleep/wakeup cycle if:
I know Turing GPUs do not, and was informed this was an issue with the (Turing-specific) firmware used with the open source modules. Would be very satisfying to know that the Turing issue isn't related to firmware which is unlikely to be fixed....
AleksandarBayrev commentedon Feb 19, 2025
Putting the comment here as well from the linked issue.
Hi there, the issue I'm facing is since the beginning of the ownership of my laptop.
Ryzen 9 7945HX + RTX 4060, Lenovo Legion Pro 5
The problem is that when I try to sleep with a plugged in external monitor (doesn't matter if it is the built-in HDMI or Type-C to DisplayPort adapter), the monitor signal itself wakes up the laptop again, other devices power off for a brief second (tested with mouse, external SSD) but after a second the machine wakes up.
These are the options
options nvidia_drm modeset=1
options nvidia_drm fbdev=1
options nvidia NVreg_EnableGpuFirmware=1
options nvidia NVreg_PreserveVideoMemoryAllocation=1
options nvidia NVreg_TemporaryFilePath=/tmp/nvidia
options nvidia NVreg_DynamicPowerManagement=0x02
options nvidia NVreg_DynamicPowerManagementVideoMemoryThreshold=0
To Reproduce
Plug in a monitor into the HDMI or Type-C to DisplayPort adapter and try to put the machine to sleep
This is what acpi_listen tells me what is happening, the laptop has a MUX switch, the iGPU is disabled from the BIOS.
HunterWhiteDev commentedon Jul 26, 2025
@Binary-Eater Is this still something you're brain storming on solving? Just curious as this issue still bugs me
Binary-Eater commentedon Jul 26, 2025
@HunterWhiteDev unfortunately,the changes are somewhat involved. Still working through them.
Does loading
nvidia-drmwith thefbdev=0parameter not work around the issue for you in the meantime? If so, the parameter can be persisted across reboots.dagbdagb commentedon Jul 26, 2025
Driver version 535.247.01 on kernel 6.14.6 enables D3cold for Turing graphics. Even after a suspend cycle. I am using these options at the moment:
options nvidia-drm modeset=0
options nvidia NVreg_DeviceFileGID=27
options nvidia NVreg_DeviceFileMode=432
options nvidia NVreg_DeviceFileUID=0
options nvidia NVreg_ModifyDeviceFiles=1
options nvidia NVreg_TemporaryFilePath=/var/tmp
options nvidia NVreg_EnableResizableBar=1
options nvidia NVreg_PreserveVideoMemoryAllocations=1
options nvidia NVreg_DynamicPowerManagement=0x02
options nvidia NVreg_EnableS0ixPowerManagement=0
options nvidia NVreg_UsePageAttributeTable=1
options nvidia NVreg_EnablePCIeGen3=1
options nvidia NVreg_EnableGpuFirmware=0
options nvidia NVreg_OpenRmEnableUnsupportedGpus=1
options nvidia NVreg_NvLinkDisable=1
Edit: I see this comment was unrelated to the version at hand. Apologies, I am subscribed to a number of RTD3 tickets and mistook this for another issue.
I am still leaving my comment in case it is of use to another soul. Never forget denvercoder9.
HunterWhiteDev commentedon Jul 26, 2025
This does seem to work for me actually! Haven't tested it too much, but setting fbdev=0 seems to allow my dGPU to suspend when I unplug my monitors. Thanks!
Binary-Eater commentedon Jul 26, 2025
Thanks @HunterWhiteDev. The changes I am proposing will enable the same while leaving
fbdev=1.mradalbert commentedon Aug 10, 2025
nvidia-drm.fbdev=0solves the issue for me as wellKimiblock commentedon Aug 10, 2025
True for me too. Though my laptop won't properly suspend anymore and REISUB doesn't work at all.
4 remaining items
Mario156090 commentedon Dec 29, 2025
Hello, when is ready this bug fix?
fbdev=0 works for me too.
Mario156090 commentedon Dec 31, 2025
Hello @Binary-Eater, can you inform us abou this fix?
Binary-Eater commentedon Jan 16, 2026
Hi folks,
Sorry for the delay. I am catching up on messages. We actually have a fix for this issue implemented that is undergoing QA testing right now. We don't plan to release the fix in the 590 series of driver releases since we do not have enough QA bandwidth to do so.
To provide a high level description of the change, on
vmapandvunmapwe enable the power state blocking logic and release it instead of having to permanent block certain power states when the framebuffer console is being driven by a DRM fbdev. This took a bit of discussion internally to get to the solution.Gronsak commentedon Jan 16, 2026
Are you able to share some sort of ETA for when we'll see this in the public drivers?
Like are we talking Q2, Q3 or even sometime in 2027?
Jmennius commentedon Feb 17, 2026
Would really appreciate this finally fixed... Using a laptop is basically impossible after having it connected to an external display. And this goes on for a long long time (years?).
Binary-Eater commentedon Mar 7, 2026
Hi folks, the fix should be out in the 595.45.04 driver. I know it has been a long wait.
Mario156090 commentedon Mar 10, 2026
Thank's a lot, what about 580.142?
Binary-Eater commentedon Mar 11, 2026
The fix is considered part of a new feature set to improve general interaction with the Nvidia stack and DRM/Wayland. We did not backport fixes to long term release branches like 580 to avoid regression risks.
EDtheWARDen commentedon Mar 17, 2026
I can confirm* that this specific issue is fixed my laptop. On driver 595.45.04 after suspend and resume my GPU can enter D3.
Host: Kantana A15 AI B8VF (REV:1.0)
Kernel: Linux 6.19.8-arch1-1
DE: KDE Plasma 6.6.2
WM: KWin (Wayland)
GPU 1: NVIDIA GeForce RTX 4060 Max-Q / Mobile [Discrete]
GPU 2: AMD Radeon 780M Graphics [Integrated]
Thank you and the team :)
sharp004 commentedon Mar 18, 2026
You mean that this new driver release also solve the problem described in #905 in your case ?
EDtheWARDen commentedon Mar 18, 2026
No, it only solved this specific issue for me (I still have to go over everything in the other thread). I just wanted to give feedback since I did not see anybody else that had been affected by this do it.
I put the *asterisk there since I did NOT get to test if it also would go to D3 after unplugging HDMI or USB-C DP
HunterWhiteDev commentedon Mar 24, 2026
Is it better now to update and then remove fbdev=0 from the command line? Does it affect performance or anything? Or does it not particularly matter?
SpiderUnderUrBed commentedon Apr 20, 2026
Dont know if this is related, but I am having an issue, with a PRIME/offloading configuration (RTD3), my igpu does all rendering unless i explicitly call nvidia, or if i connect a HDMI port to my laptop, which my nvidia card owns, the gpu should wake up, then take control of that monitor, currently it just freezes.