VeraCrypt-DCS icon indicating copy to clipboard operation
VeraCrypt-DCS copied to clipboard

Interferes with nVidia Optimus when CSM is disabled

Open kevinoid opened this issue 5 years ago • 3 comments

On a ThinkPad T430 (2342-CTO) with Nvidia Optimus (an NVIDIA NVS 5400M paired with an Intel HD4000) running Windows 10, booting in UEFI mode with Compatibility Support Module disabled using the VeraCrypt boot loader causes the NVIDIA NVS 5400M to stop working with device status "Windows has stopped this device because it has reported problems. (Code 43)" in Device Manager. Switching back to the Windows boot loader (by disabling "Encrypt System Partition/Drive") resolves the error and restores functionality.

After some experimentation, I can confirm that this only occurs when configured to boot in UEFI mode with CSM disabled. If CSM is enabled, or when booting in Legacy/BIOS mode, the error does not occur. It also does not occur when the pre-boot configuration is set to "Discrete Graphics" (which only exposes the NVIDIA NVS 5400M to the OS). I can also confirm that the error occurs with both VeraCrypt Boot Loader 1.23 (from 1.23-Hotfix-2) and 1.18 (from 1.18a).

Let me know if there is anything I can do to help isolate or fix the issue.

Thanks, Kevin

P.S. It appears this issue was also reported on the forums on a W530 by vondatuh.

kevinoid avatar May 27 '19 04:05 kevinoid

Thank you for this report and sorry for the late feedback.

It’s difficult to investigate such issues since the problem occurs in a component that belongs to others (here nVidia). It would help if someone with knowledge of nVidia driver tell us what this error means.

One possible explanation is that there is a conflict between the memory address used by VeraCrypt boot loader to communicate with the VeraCrypt driver and the memory space used by nVidia graphic card during boot to initialize itself.

This hypothesis is reinforced by the fact that if the card is disabled in UEFI mode then the issue goes away.

I don’t know what memory range the nVidia card is reserving to its self and in VeraCrypt boot loader we use standard functions to check memory availability so I don’t know what can we do more to fix this conflict.

You have done a good job in identifying the issue and finding different workarounds. I think we will have to keep it like this until we have more information.

I know it has been long time since your post but if you can still do tests on this machine, I can share some test versions to help find the memory range that the nVidia device is using.

idrassi avatar Sep 23 '19 20:09 idrassi

No worries. Thanks for the information and follow-up @idrassi!

I'm not familiar with the hardware or driver implementation details, so I don't have any useful advice for how to proceed. You may want to reach out to the Bumblebee Project and/or Dave Airlie and Matthew Garrett, who implemented vga_switcheroo in the Linux kernel (or find some useful information in Dave's blog posts discussing vga_switcheroo).

I'm still ready and willing to help test. I also don't mind continuing to use my current workarounds, so feel free to prioritize the issue however you see fit.

kevinoid avatar Sep 23 '19 22:09 kevinoid

Same here, I'm using a T430 (2349-G7G), same NVS 5400M, HD4000 and Windows 10. The Problem occurred after installing Windows 10 and switching from Legacy BIOS to UEFI with CSM disabled. Thanks @kevinoid for the workaround. After only a few hours switching Nvidia and Intel driver versions, I was able to narrow it down to Veracrypt. Never install to much stuff a the same time without reboots, I guess ... But then the "solution" was simple.

Dennis

dennis1f avatar Jul 05 '21 16:07 dennis1f