Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 652408 - x11-drivers/nvidia-drivers - something does not work when AMD Secure Memory Encryption is enabled
Summary: x11-drivers/nvidia-drivers - something does not work when AMD Secure Memory E...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: David Seifert
Depends on:
Reported: 2018-04-04 12:11 UTC by Gabriel Caudrelier
Modified: 2021-03-06 08:48 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
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 -->

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 (RETIRED) 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


[    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:
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 : []
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.
Comment 7 Ionen Wolkens 2021-03-06 08:48:02 UTC
I don't think there's much that can be done here about this.

At best could add a kernel config check for CONFIG_AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT
To at least discourage users from using it (can't check for merely enabled as this is a default in gentoo-kernel{,-bin}).