3

I'm working with a Debian 11 VM with secure boot enable on Google Cloud.

When I add a GPU to the machine, I get the following prompt:

This VM requires Nvidia drivers to function correctly. 
Would you like to install the Nvidia driver? [y/n] 

The installation fails with the following errors:

WARNING: The nvidia-drm module will not be installed. As a result, DRM-KMS will not function with this installation of the NVIDIA driver.

ERROR: The kernel module failed to load. Secure boot is enabled on this system, so this is likely because it was not signed by a key that is trusted by the kernel. Please try installing the driver again, and sign the kernel module when prompted to do so.

ERROR: Unable to load the kernel module 'nvidia.ko'.  This happens most frequently when this kernel module was built against the wrong or improperly configured kernel sources, with a version of gcc that differs from the one used to build the target kernel, or if another driver, such as nouveau, is present and prevents the NVIDIA kernel module from obtaining ownership of the NVIDIA device(s), or no NVIDIA device installed in this system is supported by this NVIDIA Linux graphics driver release.

ERROR: Installation has failed.  Please see the file '/var/log/nvidia-installer.log' for details.  You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.

I understand this is a problem with Secure Boot. However the official Google guide here deals with the Secure Boot only on Ubuntu machines.

The output of

nvcc --version

is

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Mon_Apr__3_17:16:06_PDT_2023
Cuda compilation tools, release 12.1, V12.1.105
Build cuda_12.1.r12.1/compiler.32688072_0

1 Answer 1

1

Edited short-ish version.

While secure boot is enabled you cannot use unsigned dkms modules. If you want to keep using dkms and secure boot, you need en ensure the module can be trusted by secure boot. In order to do so, you need to digitally sign the modules built by dkms. Generally, as Ubuntu is somewhat based on Debian, the instructions on how to do so on Debian should be similar to (not necessarily the same as) those of doing so on Ubuntu. Now, my original post linking directly to the relevant wiki page was deleted due to insufficient context but I am going to add a link again hoping that this time my post is deemed worthy of living up to the standards of unix.stackexchange. There is a page on the Debian wiki (also available on web archive) on secure boot which also details how to digitally sign the module, perhaps this might prove helpful to you in combination with the official documentation from Google Cloud (also available on web archive) on installing in virtual machines with secure boot enabled.

Alternatively, you might be able to disable secure boot to circumvent the issue you are experiencing but I am sure someone eventually is going to chime in on why that is not just bad idea but also potentially security a concern.

3
  • Please note, your previous answer was removed, because it was plain link-only. Nothing against links in general! On the contrary, we welcome links to relevant resources. But since you provided hardly any text of your own, it was needed to remove as links disappear/change in time. More on How to write a good answer. Commented Jun 17 at 17:29
  • Wow, the censorship is real. The entire concept of censoring/locking/deleting posts without any dialogue beforehand is senseless - if you lot had left my original post both with reasonable feedback AND available for editing then I actually would have done so and this interaction could have been avoided but it was deleted before I got the chance to do so. The arch linux community had a bad rep years ago and this is reminding me a lot of that. Honestly, I do not really know why I bother, you are likely going to lock, edit or delete this post/comment anyway...
    – ndx
    Commented Jun 18 at 8:47
  • I do not have much time for dialogue. Just noted in the edit that "offensive" text removed which should be enough. And it was damn offensive to poke on mods... Cheers, and good luck! Commented Jun 18 at 15:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .