Ask Your Question

Build Nvidia Driver from source

asked 2013-02-06 13:39:05 -0500

chlebta gravatar image

updated 2014-09-28 08:38:36 -0500

mether gravatar image

I'm trying to build the nvidia Driver (Geforce 525M). But I got this error :

ERROR: Unable to load the kernel module 'nvidia.ko'. This is most likely

    because the kernel module was built using the wrong kernel source

    files.  Please make sure you have installed the kernel source files

    for your kernel; on Red Hat Linux systems, for example, be sure you

    have the 'kernel-source' rpm installed.  If you know the correct

    kernel source files are installed, you may specify the kernel source

    path with the '--kernel-source-path' commandline option

Take look at log file :

Sorry i havn't uploaded it here because it showing me error Data is Undifinded

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2013-02-06 13:50:06 -0500

ryanlerch gravatar image

updated 2013-02-06 14:15:55 -0500

Taking a guess here, but I am pretty sure that you also need to install the kernel-headers package as well.

Also, if you recently updated, you may have a different version of the kernel package running compared to kernel-devel one just installed. Try rebooting the machine, to make sure the most recent kernel installed is running and then try to run the nvidia installer again.

edit flag offensive delete link more


would you be able to update the original question with nvidia-installer.log?

also, if you recently updated, you may have a different version of the kernel package running compared to kernel-devel one just installed. Try rebooting the machine, and trying to run the nvidia installer again.

ryanlerch gravatar imageryanlerch ( 2013-02-06 14:13:18 -0500 )edit

also, are you running the nvidia install command as root?

ryanlerch gravatar imageryanlerch ( 2013-02-06 15:14:29 -0500 )edit

Here is another thread that has a detailed step-by-step on how to install the drivers on f18.

ryanlerch gravatar imageryanlerch ( 2013-02-06 15:17:00 -0500 )edit

answered 2013-02-06 17:23:29 -0500

hhlp gravatar image

updated 2013-02-06 17:26:20 -0500

it seem you are trying to compile the proprietary nvidia driver from nvidia website.

you have prepare your system for compiling :

sudo yum install kernel-devel kernel-headers gcc

do a yum update to make sure you're on newest kernel release, better to not have to do this twice

sudo yum update

change default runlevel to multi-user (the old init 3)

sudo ln -fs /lib/systemd/system/ /etc/systemd/system/

reboot into the new kernel & runlevel

shutdown -r now

make sure Open source nouveau driver is blacklisted from starting on next reboot.

sudo egrep -i "blacklist\s*nouveau" /etc/modprobe.d/blacklist.conf || echo "blacklist nouveau" >> /etc/modprobe.d/blacklist.conf

move the nouveau module out of the default path so that we won't have it built into the new initramfs.

sudo mv /usr/lib/modules/$(uname -r)/kernel/drivers/gpu/drm/nouveau/nouveau.ko /usr/lib/modules/$(uname -r)/kernel/drivers/gpu/drm/nouveau/nouveau.ko.blacklist

move the old initramfs to a backup location. Not strictly necessary, but a good idea to keep backups IMO, feel free to skip this step.

sudo mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).nouveau.img

make the new initramfs.

sudo dracut /boot/initramfs-$(uname -r).img $(uname -r)

reboot into new initramfs where nouveau won't be loaded.

shutdown -r now

cd to where you downloaded the NVIDIA driver. In my case, it was in my Downloads directory.

cd ~username/Downloads

make the file executable, and run it, follow onscreen instructions

chmod 700 NVIDIA-Linux-*.run
sudo ./NVIDIA-Linux-*.run

If you're running any proprietary games (to include steam games) make sure to install the 32 bit compatibility drivers, and update the xorg.conf file when prompted.

when it is installed, change back to the default runlevel,

sudo ln -fs /lib/systemd/system/ /etc/systemd/system/

and reboot

shutdown -r now

When your system comes back up, you should be at the graphical login screen. Log in, open a teminal, and run


however use the propietary nvidia drivers that provide fedora packed, Here is a good link for installing via RPMFusion. They are a great deal easier:

edit flag offensive delete link more

Question Tools


Asked: 2013-02-06 13:39:05 -0500

Seen: 6,914 times

Last updated: Feb 07 '13