Saturday 31 August 2013

Install NVIDIA Proprietary Driver in Kali Linux and Debian wheezy

If you are using Linux and have NVIDIA graphics card then most likely you are using open source NVIDIA driver nouveau. It works quite well, but if you want to use 3D acceleration feature or want to use GPU based applications then you need to install NVIDIA proprietary driver. Here is how to do it. First Install linux headers as those will be required to build nvidia modules. Issue following command at terminal
$ aptitude -r install linux-headers-$(uname -r)
Now install required nvidia components. Following command will install and build nvidia modules, and also disable nouveau module.
$ aptitude install nvidia-kernel-dkms
Now we should create new Xorg server configuration file or modify existing to tell it to load nvidia module. nvidia-xconfig package make this task quite easy, install and execute it.
$ aptitude install nvidia-xconfig
$ nvidia-xconfig
Now reboot and check if system is using nvidia graphics driver. On start of xsession nvidia splash screen should be displayed. You can also confirm it by issuing following commands
First check if system is using glx module.
$ glxinfo | grep -i "direct rendering"
It should output "direct rendering: Yes"
If you do not have glxinfo then first install mesa-utils package then again issue above command and check output
$ aptitude install mesa-utils
Check if nvidia module loaded.
$ lsmod | grep nvidia
If it produces output like 'nvidia      11239499  45' or something similar (numbers could be different at your system) then nvidia module is loaded.
Just to be sure nouveau module NOT loaded, issue following command
$ lsmod | grep nouveau
It should NOT produce any output. If it produces output then something is wrong.
If you are planning to use NVIDIA Graphics Driver just for better disply and 3D rendering then it is almost finished. But if you want to run applications that uses NVIDIA CUDA for processing (like cudahashcat+) then you will also need to install CUDA drivers as below
$ aptitude install nvidia-cuda-toolkit nvidia-opencl-icd
 Now you should be able to use applications designed to utilize GPU.

5 comments:

  1. good work and thanks, but when i boot up from grub it changes resultion to 600x400, anyway to fix that? when it boots up i see nvidia is loaded, just not picking it up on boot and looks sloppy

    ReplyDelete
  2. If i am not wrong you are getting 640x480 resolution during boot but after booting you are getting correct display. Right?

    To fix boot time resolution you need to edit /boot/grub/grub.cfg
    Open it in editor and locate the boot entry line and append there vga=0x305 at the end.
    For example my grub.cfg has following line

    linux /vmlinuz-3.7-trunk-amd64 root=UUID=ab3593f8-a05c-491d-bc20-3015a2653dfe ro initrd=/install/gtk/initrd.gz quiet

    I changed it to following

    linux /vmlinuz-3.7-trunk-amd64 root=UUID=ab3593f8-a05c-491d-bc20-3015a2653dfe ro initrd=/install/gtk/initrd.gz quiet vga=0x305

    Caution: Do "NOT* copy and paste above line to your grub.cfg, it may make your system not to boot as configure and UUID may differ.

    HTH!

    ReplyDelete
  3. Man, I. LOVE. YOU.
    you've helped me a lot!
    Thanks

    ReplyDelete
  4. Still can't get Cpyrit to see my GPU cores :/ all the outputs I got were correct. I even have multiforcer working fine on both my GPU.. D:

    ReplyDelete