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!

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容