Skip to content

NVIDIA driver installation fails on EC2 g6f.xlarge (Ubuntu) with "Unable to load the kernel module 'nvidia-drm.ko'"

0

I am attempting to set up a new g6f.xlarge instance to run a custom FFmpeg build, including vulkan. I tried following the official guide to install GRID drivers on ubuntu. I followed all the steps, but when running sudo /bin/sh ./NVIDIA-Linux-x86_64*.run (NVIDIA Proprietary) I got this error:

ERROR: Unable to load the kernel module 'nvidia-drm.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. Please see the log entries 'Kernel module load error' and 'Kernel messages' at the end of the file '/var/log/nvidia-installer.log' for more information.

ERROR: The nvidia-drm kernel module failed to load. This kernel module is required for the proper operation of DRM-KMS. If you do not need to use DRM-KMS, you can try to install this driver package again with the '--no-drm' option.

I inspected the whole var/log/nvidia-installer.log file. The log stops abruptly in the middle of compiling the nvidia-uvm module. While the process was compiling the individual files, A TON of

warning: suggest braces around empty body in an ‘if’ statement

warnings appeared. There are also some warnings about tainting the kernel:

nvidia: module verification failed: signature and/or required key missing - tainting kernel

The log ends abruptly after compiling a few files within the nvidia-uvm module, without a completion or error message. These are the final lines:

[numbers...] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms 570.172.08 Tue Jul 8 17:57:10 UTC 2025 [ numbers...] nvidia_drm: Unknown symbol drm_fbdev_ttm_driver_fbdev_probe (err -2) [ numbers...] nvidia-modeset: Unloading [ numbers...] nvidia-nvlink: Unregistered Nvlink Core, major device number 235 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 checked the linux headers version but they are matching:

ubuntu@ip-172-*1-*4-7*:/$ uname -r
6.14.0-1012-aws
ubuntu@ip-172-*1-*4-7*:/$ ls /usr/src/ | grep linux-headers
linux-headers-6.14.0-1011-aws
linux-headers-6.14.0-1012-aws

I disabled nouveau as instructed in the guide

cat << EOF | sudo tee --append /etc/modprobe.d/bl#cklist.conf
bl#cklist vga16fb
bl#cklist nouveau
bl#cklist rivafb
bl#cklist nvidiafb
bl#cklist rivatv
EOF

Edited the /etc/default/grub file adding the following line:

GRUB_CMDLINE_LINUX="rdbl#cklist=nouveau"

Another thing I did is this

sudo apt-get install -y gcc make build-essential dkms

PS: replaced black -list with bl#cklist to be able to post this

asked a year ago980 views

2 Answers
2
Accepted Answer
sudo /bin/sh ./NVIDIA-Linux-x86_64*.run (NVIDIA Proprietary)

Try installing NVIDIA Open drivers instead

I was able to install NVIDIA GRID on g6f.large instance running Ubuntu 24.04 using the install script from this article. Screenshot below

Ubuntu G6f

AWS
EXPERT

answered a year ago

EXPERT

reviewed a year ago

  • I just found out that installing linux-modules-extra-$(uname -r) solves the problem. It's included in the guide you linked too. Thank you

-1

For G6f instances, you need to ensure you're using the correct NVIDIA GRID driver version. According to AWS documentation, G6f instances specifically require GRID 18.4 or later.

The error you're encountering with "Unable to load the kernel module 'nvidia-drm.ko'" is often related to kernel compatibility issues. Here are some steps to resolve this:

  1. Make sure you have all the necessary dependencies installed:
sudo apt update
sudo apt install -y gcc make build-essential dkms linux-headers-$(uname -r)
  1. When running the NVIDIA installer, try adding the --no-drm flag as suggested in the error message:
sudo /bin/sh ./NVIDIA-Linux-x86_64*.run --no-drm
  1. Alternatively, consider using a supported Amazon Machine Image (AMI) that already has the NVIDIA drivers pre-installed. This is actually a best practice as noted by AWS, as it eliminates the need for manual driver installation.

  2. If you must update your kernel for security patches, be aware that this can break compatibility with the installed NVIDIA driver. In such cases, you may need to reinstall the driver after the kernel update.

  3. For Ubuntu instances, you might need to install or update additional packages if the NVIDIA installer fails. The specific requirements depend on your operating system and kernel version.

The warnings about "tainting the kernel" are normal when installing third-party kernel modules like NVIDIA drivers and don't necessarily indicate a problem.

If these steps don't resolve the issue, you might want to consider using the AWS Deep Learning AMIs which come with optimized NVIDIA drivers pre-installed for better compatibility with GPU instances.
Sources
NVIDIA drivers for your Amazon EC2 instance - Amazon Elastic Compute Cloud
Resolve NVIDIA GPU and GPU driver issues in Amazon EC2 | AWS re:Post

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.