{"slug": "nvidia-graphics-card-faulting-after-sleep-wake-cycle-on-void-linux", "title": "NVIDIA graphics card faulting after sleep/wake cycle on Void Linux", "summary": "On Void Linux, an NVIDIA MX150 GPU in a ThinkPad T480 was experiencing CUDA initialization failures after sleep/wake cycles due to corrupted GPU memory mappings and MMU faults. The solution involves adding the kernel parameters `nvidia-drm.modeset=1` and `nvidia.NVreg_PreserveVideoMemoryAllocations=1` to the GRUB command line, which preserves GPU memory allocations across suspend/resume and prevents the hardware from entering an inconsistent state.", "body_md": "NVIDIA graphics card faulting after sleep/wake cycle on Void Linux\nI run Void Linux on a Thinkpad T480 with Integrated Intel graphics and a discrete Nvidia MX150. I’ve decided to start working with more CUDA development and was running into an issue where my Nvidia GPU would suddenly stop being detected by CUDA applications. The only way I could figure out to get it back online was by rebooting my computer. Eventually I became so frustrated that I decided to dive in and find a solution.\nThe Problem\nHere’s what I was experiencing:\n- GPU appeared normal in\nnvidia-smi\n- All NVIDIA kernel modules were loaded correctly\n- Device files in\n/dev/nvidia*\nexisted with proper permissions - But testing CUDA availability using Pytorch, by running the following command would return FAlSE:\n1 python -c \"import torch; print(torch.cuda.is_available())\"\nThe root cause was eventually found in the kernel logs (dmesg\n):\nNVRM: Xid (PCI:0000:01:00): 31, pid=1596, name=modprobe, Ch 00000003,\nintr 10000000. MMU Fault: ENGINE HOST6 HUBCLIENT_HOST faulted @ 0x1_01010000.\nFault is of type FAULT_PDE ACCESS_TYPE_READ\nNVRM: Xid (PCI:0000:01:00): 154, GPU recovery action changed from 0x0 (None)\nto 0x2 (Node Reboot Required)\nThe Root Cause\nThe issue stems from NVIDIA GPU memory management during sleep/resume cycles. When the system suspends:\n- The GPU’s memory mappings and contexts can become corrupted\n- The GPU’s Memory Management Unit (MMU) enters a faulted state\n- While the driver stack appears to reload correctly, the GPU hardware itself is in an inconsistent state\n- CUDA runtime fails to initialize because it can’t establish proper memory contexts\nThis seems to be common on mobile NVIDIA GPUs (like the MX series) in laptops with hybrid graphics setups running Linux. At least, I’ve seen a few postings about this.\nThe Solution\nThe fix is to add these parameters to your kernel command line in /etc/default/grub\n:\n1GRUB_CMDLINE_LINUX_DEFAULT=\"... nvidia-drm.modeset=1 nvidia.NVreg_PreserveVideoMemoryAllocations=1\"\nThen update GRUB:\n1sudo update-grub\nAnd reboot to apply the changes.\nWhat These Parameters Do\nnvidia-drm.modeset=1\n: Enables kernel mode setting for the NVIDIA driver, providing better integration with the display subsystem and more robust power managementnvidia.NVreg_PreserveVideoMemoryAllocations=1\n: Tells the NVIDIA driver to preserve GPU memory allocations across suspend/resume cycles, preventing the MMU faults\nWhy This Works\nThese parameters ensure that:\n- GPU memory contexts are properly preserved during sleep\n- The kernel’s display management system maintains better control over the GPU state\n- Memory mappings remain consistent across suspend/resume cycles\n- The GPU’s MMU doesn’t enter the faulted state that breaks CUDA\nConclusion\nHaven’t had an issue since making this fix! Hopefully someone else can benefit from this as well!", "url": "https://wpnews.pro/news/nvidia-graphics-card-faulting-after-sleep-wake-cycle-on-void-linux", "canonical_source": "https://www.alexselimov.com/posts/nvidia_cuda_sleep_issue/", "published_at": "2025-09-04 23:44:19+00:00", "updated_at": "2026-05-23 08:35:49.167843+00:00", "lang": "en", "topics": ["hardware", "open-source"], "entities": ["NVIDIA", "Void Linux", "Thinkpad T480", "Intel", "MX150", "CUDA", "Pytorch"], "alternates": {"html": "https://wpnews.pro/news/nvidia-graphics-card-faulting-after-sleep-wake-cycle-on-void-linux", "markdown": "https://wpnews.pro/news/nvidia-graphics-card-faulting-after-sleep-wake-cycle-on-void-linux.md", "text": "https://wpnews.pro/news/nvidia-graphics-card-faulting-after-sleep-wake-cycle-on-void-linux.txt", "jsonld": "https://wpnews.pro/news/nvidia-graphics-card-faulting-after-sleep-wake-cycle-on-void-linux.jsonld"}}