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!

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容