Step 1: Install the Kali Linux on hard drive. After the installation process complete restart the computer.

Setp 2: Now you will see the Kali Linux Grub Bootloader with a blue screen.  From the GRUB loader select Kali Linux and press E. Navigate cursor to row where starting with Linux then on the end of the row replace “quiet splash” with “nouveau.modeset=0” (without quote marks). Then press F10. Now Kali Linux will boot normally.

Step 3: After Kali Linux booted up run this command below.

apt-get update
apt-get upgrade
apt-get dist-upgrade

After that follow the steps below to install Nvidia drivers:

Step 4: Before we begin, you’ll need to make sure you have the kernel headers for your currently active kernel, in order to build the NVIDIA driver kernel modules type:

apt install linux-headers-$(uname -r)

This will automatically resolve the kernel headers package required for the kernel you are currently using.
Step 5: Disable nouveau

echo -e "blacklist nouveau\noptions nouveau modeset=0\nalias nouveau off" > /etc/modprobe.d/blacklist-nouveau.conf
update-initramfs -u && reboot

Now system will reboot and nouveau should be disabled.

Step 6: Verify if nouveau is disabled:

lsmod |grep -i nouveau

If this command shows nothing, that means nouveau has successfully disabled.

Step 7: Install Nvidia driver from kali repository:

apt-get install nvidia-driver nvidia-xconfig

Step 8: Find bus id of nvidia card:

nvidia-xconfig --query-gpu-info | grep 'BusID : ' | cut -d ' ' -f6

>>My result: PCI:1:0:0
>>PCI:1:0:0 This is our Bus ID.
——————————————————–
Step 9: Now we generate /etc/X11/xorg.conf file with this bus ID according to nvidia guide http://us.download.nvidia.com/XFree8…E/randr14.html:

Section "ServerLayout"
Identifier "layout"
Screen 0 "nvidia"
Inactive "intel"
EndSection

Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:1:0:0"
EndSection

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

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

Section "Screen"
Identifier "intel"
Device "intel"
EndSection

>>Replace the BusID value with your Bus ID and save it to /etc/X11/xorg.conf

Step 10: Now we have to create some scripts according to our display manager https://wiki.archlinux.org/index.php…splay_Managers. Since im using default Kali linux which is GDM, i created two files:
/usr/share/gdm/greeter/autostart/optimus.desktop
/etc/xdg/autostart/optimus.desktop
with the following content:

[Desktop Entry]
Type=Application
Name=Optimus
Exec=sh -c "xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto"
NoDisplay=true
X-GNOME-Autostart-Phase=DisplayServer

Step 11: Now reboot and you should be using Nvidia Driver.Verify if everything is ok:

apt-get install mesa-utils
glxinfo | grep -i "direct rendering"

>>Result Should be “direct rendering: Yes”