Install NVIDIA driver on VirtualBox Fedora 22

Hi,

i’m trying to create Fedora LiveISO with livecd-creator.

During one of the steps, I would like to install NVIDIA Driver.

Using Fedora 22 on VirtualBox, with no NVIDIA graphic card of course.

I’m using this installer : NVIDIA-Linux-x86_64-340.46.run.
Because we have Quadro NVS 300 on our machines, and i would like nvidia driver to be load on my LiveOS in order to check GPU 770 state.

I extract first all files from archive, done some patches :

sed -i ‘s/f_dentry/f_path.dentry/’ kernel/nv.c
sed -i ‘s/f_dentry/f_path.dentry/’ kernel/nv-frontend.c
sed -i ‘/#include <drm/drmP.h>/a #include <drm/drm_gem.h>’ kernel/nv-drm.c
sed -i ‘s/read_cr4/__read_cr4/’ kernel/nv-pat.c
sed -i ‘s/write_cr4/__write_cr4/’ kernel/nv-pat.c

and launch :
./nvidia-installer --no-x-check --no-cc-version-check

But i have this mesage :
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 a driver such as rivafb, nvidiafb, or nouveau is present and prevents the NVIDIA kernel module from obtaining ownership of the NVIDIA graphics device(s), or no NVIDIA GPU installed in this system is supported by this NVIDIA Linux graphics driver release.

What i need to do ?
Disable nouveau on my VirtualBox Fedora installation, re-generate initramfs ?
How to skip nvidia modprobe at the end of the driver compilation and make it OK ?

Thanks,
Sylvain

Wouldn’t it be easier to use rpm nvidia packages for your livecd?

No, due to my Quadro NVS 300

Tried to install akmod-nvidia-340xx-340.76-2.fc22.12.x86_64.rpm, but NVS 300 not supported.

Last driver version which support NVS 300 is 340.46

And did not find akmod-nvidia rpm version 340.46 for fc22.

Perhaps I got you wrong but are you installing NVIDIA drivers inside a VM? If it’s so then
VirtualBox has its own virtual GPU - you cannot use NVIDIA drivers inside a VM.

340.93 is listed as supporting your card

http://us.download.nvidia.com/XFree86/Linux-x86/340.93/README/supportedchips.html

Yes, but for working in LiveOS, not VirtualBox.

OK, found my problem with akmod-nvidia-340xx-340.76-2.fc22.12.x86_64.rpm.

I disabled “nouveau” but did not regenerate initramfs with “dracut” and did not copy new initramfs in place of initrd0.img in “isolinux” root folder of my LiveOS.

Else, when i boot, there was conflict between “nouveau” which is loaded by kernel, and “nvidia” which is loaded by Xorg.

Now, all works.

Sorry if you left time.
But your answers show me the good way.

Thanks