Install NVIDIA Driver in Kali Linux

Disable X-Server

sudo service lightdm stop

Install Linux-header

  • Get Kernel version by uname -a
  • Install header
    sudo apt install linux-headers-4.14.0-kali3-amd64 linux-headers-4.14.0-kali3-common linux-headers-4.14.0-kali3-all

Block nouveau driver

echo -e "blacklist nouveau\noptions nouveau modeset=0\nalias nouveau off" |sudo tee /etc/modprobe.d/blacklist-nouveau.conf
update-initramfs -u && reboot
  • Check whether succeed or not
    lsmod |grep -i nouveau
    If without any output that means to succeed.

Download NVIDIA Driver from Official Website

Install NVIDIA Driver

chmod a+x NVIDIA-Linux-*
sudo ./NVIDIA-Linux-*

Configure driver setting

  • Get your graphics card 's BusID
    nvidia-xconfig --query-gpu-info
  • Add the following code into /etc/X11/xorg.conf
    sudo vim /etc/X11/xorg.conf
Section "ServerLayout"
 Identifier "layout"
 Screen 0 "nvidia"
 Inactive "intel"
EndSection

Section "Device"
 Identifier "nvidia"
 Driver "nvidia"
 BusID "Your BusID"
EndSection

Section "Screen"
 Identifier "nvidia"
 Device "nvidia"
 Option "AllowEmptyInitialConfiguration"
EndSection

Section "Device"
 Identifier "intel"
 Driver "modesetting"
EndSection

Section "Screen"
 Identifier "intel"
 Device "intel"
EndSection
  • Set up /usr/share/gdm/greeter/autostart/optimus.desktop And /etc/xdg/autostart/optimus.desktop
    adding the following code.
[Desktop Entry]
Type=Application
Name=Optimus
Exec=sh -c "xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto"
NoDisplay=true
X-GNOME-Autostart-Phase=DisplayServer

Reboot and Done!

你可能感兴趣的:(Install NVIDIA Driver in Kali Linux)