Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 652408

Summary: x11-drivers/nvidia-drivers - something does not work when AMD Secure Memory Encryption is enabled
Product: Gentoo Linux Reporter: Gabriel Caudrelier <gabriel.caudrelier>
Component: Current packagesAssignee: Jeroen Roovers <jer>
Status: UNCONFIRMED ---    
Severity: normal CC: bruce
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Gabriel Caudrelier 2018-04-04 12:11:31 UTC
This is an FYI but nvidia drivers do not work when AMD Secure Memory Encryption is enabled in the kernel.

The only relevant message in dmesg is this one :

nvidia 0000:41:00.0: SME is active, device will require DMA bounce buffers

Kernel configuration to disable:

Processor type and features -->
  CONFIG_AMD_MEM_ENCRYPT

Tested against 4.14.31/32 but is probably the same on 14.15.x

This feature was introduced in 4.14.x as far as I understand, so not a problem before this version.

Maybe worth adding it to the wiki.
Comment 1 Jeroen Roovers gentoo-dev 2018-04-04 13:16:53 UTC
What doesn't work when AMD Secure Memory Encryption is enabled?
Comment 2 Gabriel Caudrelier 2018-04-04 23:32:10 UTC
The kernel modules load properly, but when starting sddm I get a blank screen.
Comment 3 Gabriel Caudrelier 2018-04-05 13:30:59 UTC
My bad, the nvidia modules do not initialize properly at all, I missed the logs earlier

# dmesg

[   31.630667] nvidia 0000:41:00.0: SME is active, device will require DMA bounce buffers
[   31.832968] NVRM: RmInitAdapter failed! (0x24:0x1e:1087)
[   31.832991] NVRM: rm_init_adapter failed for device bearing minor number 0


Xorg.0.log


[    44.433] (**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32
[    44.433] (==) NVIDIA(0): RGB weight 888
[    44.433] (==) NVIDIA(0): Default visual is TrueColor
[    44.433] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
[    44.433] (**) NVIDIA(0): Enabling 2D acceleration
[    44.650] (EE) NVIDIA(GPU-0): Failed to initialize the NVIDIA GPU at PCI:65:0:0.  Please
[    44.650] (EE) NVIDIA(GPU-0):     check your system's kernel log for additional error
[    44.650] (EE) NVIDIA(GPU-0):     messages and refer to Chapter 8: Common Problems in the
[    44.650] (EE) NVIDIA(GPU-0):     README for additional information.
[    44.650] (EE) NVIDIA(GPU-0): Failed to initialize the NVIDIA graphics device!
[    44.650] (EE) NVIDIA(0): Failing initialization of X screen 0


By the way this was tested against sys-kernel/gentoo-sources-4.15.15

Again, disabling CONFIG_AMD_MEM_ENCRYPT makes things work again.
Comment 4 Gabriel Caudrelier 2018-08-26 19:05:06 UTC
Update for kernel 4.18.5 (at the time of this writing this is a supposedly a supported kernel version by NVidia)

The nvidia drivers now works when CONFIG_AMD_MEM_ENCRYPT is enabled, but not if SME is enabled by default, with CONFIG_AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT.

Which is roughly the same to say that it does not work with SME.

Same error messages.
Comment 5 Maxxim 2020-07-29 19:54:59 UTC
Same here, Gentoo Linux amd64, AMD Ryzen 5 2600X, NVIDIA RTX 2060 Super.

Errors in Xorg.0.log when starting X:
(EE) NVIDIA(GPU-0): Failed to initialize DMA
(EE) NVIDIA(0): Failed to allocate push buffer

Tested with gentoo-sources 5.4.48 and nvidia-drivers 450.57.

It would seem NVIDIA has been aware of this bug for quite a while, but is either unable or unwilling to fix it:
https://forums.developer.nvidia.com/t/unable-to-start-x-failed-to-initialize-dma/64925/12
Comment 6 Maxxim 2020-08-13 15:49:31 UTC
It would seem this is not going to be fixed anytime soon. This is the reply I now got from NVIDIA after opening a bug back in February:

AMD SME is not supported in NVIDIA Linux driver. Driver README calls out that user needs to disable SME : [https://download.nvidia.com/XFree86/Linux-x86_64/450.57/README/dma_issues.html]
Engineering team is currently evaluating multiple options to support this feature in future, however we can not commit any timeline for it at this moment.