逛遍國(guó)內(nèi)論壇都沒解決kalilinux顯卡驅(qū)動(dòng)的痛相速,現(xiàn)在參考國(guó)外大神的文章完美解決了!
感謝此文章https://forums.kali.org/showthread.php?35748-TUTORIAL-Installing-official-NVIDIA-driver-in-Optimus-laptop
連續(xù)工作4天后,我終于能夠在我的HP Envy 15筆記本電腦上安裝并運(yùn)行官方NVIDIA驅(qū)動(dòng)程序煞聪。這是我的規(guī)格:
CPU: Intel core i7-4510U CPU
GPU #1: Intel HD Graphics 4400
GPU #2: NVIDIA GeForce GTX 850M
我的系統(tǒng):
Code:
root@linux:~# uname -a
Linux linux 4.9.0-kali3-amd64 #1 SMP Debian 4.9.13-1kali3 (2017-03-13) x86_64 GNU/Linux
Code:
root@linux:~# cat /etc/*release*
DISTRIB_ID=Kali
DISTRIB_RELEASE=kali-rolling
DISTRIB_CODENAME=kali-rolling
DISTRIB_DESCRIPTION="Kali GNU/Linux Rolling"
PRETTY_NAME="Kali GNU/Linux Rolling"
NAME="Kali GNU/Linux"
ID=kali
VERSION="2016.2"
VERSION_ID="2016.2"
ID_LIKE=debian
ANSI_COLOR="1;31"
HOME_URL="http://www.kali.org/"
SUPPORT_URL="http://forums.kali.org/"
BUG_REPORT_URL="http://bugs.kali.org/"
***使用有風(fēng)險(xiǎn)***
*本教程適用于官方NVIDIA驅(qū)動(dòng)程序而非Bumblebee
*在Kali官方網(wǎng)站上找到的教程是不行p骸!层释!它永遠(yuǎn)不適用于支持集成顯卡搭配獨(dú)立顯卡的筆記本電腦
1.確認(rèn)您有混合圖形
Code:
lspci | grep -E "VGA|3D"
00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 0b)
0a:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 850M] (rev a2)
2.屏蔽nouveau
Code:
echo -e "blacklist nouveau\noptions nouveau modeset=0\nalias nouveau off" > /etc/modprobe.d/blacklist-nouveau.conf
update-initramfs -u && reboot
3.system將重啟并且nouveau應(yīng)該被禁用婆瓜。如果禁用nouveau,則驗(yàn)證:
Code:
lsmod |grep -i nouveau
如果沒有顯示贡羔,則表示已成功禁用nouveau廉白。
4.從kali repo安裝nvidia驅(qū)動(dòng)程序:
Code:
apt-get install nvidia-driver nvidia-xconfig
You can also download latest .run file from nvidia website.execute and procceed with installation.whether its from kali repo or nvidia website,procedure is same.
5.現(xiàn)在我們必須找到我們的nvidia卡的總線ID:
Code:
nvidia-xconfig --query-gpu-info | grep 'BusID : ' | cut -d ' ' -f6
它應(yīng)該顯示如下:
Code:
PCI:10:0:0
這是Bus ID.
6.現(xiàn)在我們根據(jù)nvidia指南http://us.download.nvidia.com/XFree8...E/randr14.html生成帶有此總線ID的/etc/X11/xorg.conf文件:
Code:
vim /etc/X11/xorg.conf
復(fù)制以下代碼進(jìn)去
Section "ServerLayout"
Identifier "layout"
Screen 0 "nvidia"
Inactive "intel"
EndSection
Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:10: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
用您的總線ID替換粗體字符串并將其保存到/etc/X11/xorg.conf
7.現(xiàn)在我們必須根據(jù)我們的顯示管理器https://wiki.archlinux.org/index.php...splay_Managers創(chuàng)建一些腳本。因?yàn)槲沂褂媚J(rèn)的Kali linux是GDM乖寒,我創(chuàng)建了兩個(gè)文件:
vim /usr/share/gdm/greeter/autostart/optimus.desktop
vim /etc/xdg/autostart/optimus.desktop
2個(gè)具有以下內(nèi)容:
Code:
[Desktop Entry]
Type=Application
Name=Optimus
Exec=sh -c "xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto"
NoDisplay=true
X-GNOME-Autostart-Phase=DisplayServer
8.現(xiàn)在重新啟動(dòng)猴蹂,你應(yīng)該使用Nvidia Driver.Verify如果一切正常,檢查硬件加速:?jiǎn)⒂没谟布?3D 加速可以在繪制 3D 圖形時(shí)直接使用硬件進(jìn)行處理宵统,這大大加快了 3D 渲染的速度晕讲,要使用該功能,必需顯卡支持硬件加速并安裝了正確的驅(qū)動(dòng)马澈,可以使用 glxinfo 命令來獲查看得 OpenGL 的詳細(xì)信息:
root@kali:~# glxinfo | grep -i "direct rendering"
direct rendering: Yes
root@kali:~# glxinfo | grep OpenGL
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GT 720M/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 390.87
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6.0 NVIDIA 390.87
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 390.87
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:
可選:您現(xiàn)在可以安裝cuda工具包:cuda toolkits:
Code:
apt-get install ocl-icd-libopencl1 nvidia-cuda-toolkit
固定屏幕撕裂問題:
使用Nvidia Driver成功啟動(dòng)后瓢省,您很可能會(huì)遇到屏幕撕裂問題,例如:在VLC中播放視頻痊班,在Chrome / Firefox上播放YouTube視頻等勤婚。幸運(yùn)的是,我們可以通過啟用PRIME Sync來解決此問題涤伐。
1.驗(yàn)證PRIME是否被禁用
Code:
xrandr --verbose|grep PRIME
顯示如下:
PRIME Synchronization: 0
PRIME Synchronization: 1
第一個(gè)是我們連接的顯示器馒胆。因此PRIME同步被禁用。
2.編輯/etc/default/grub在GRUB_CMDLINE_LINUX_DEFAULT中
并在quiet后在附加nvidia-drm.modeset = 1.如下所示:
Code:
....
GRUB_CMDLINE_LINUX_DEFAULT="quiet nvidia-drm.modeset=1"
...
3.保存更改凝果。更新grub
Code:
update-grub
4.重啟系統(tǒng).
5.驗(yàn)證PRIME開啟:
Code:
xrandr --verbose|grep PRIME
現(xiàn)在應(yīng)該輸出:
PRIME Synchronization: 1
PRIME Synchronization: 1
如果它仍然為你顯示0祝迂,那么你的系統(tǒng)配置/內(nèi)核可能有問題。由于這仍然是Nvidia的實(shí)驗(yàn)性功能器净,你運(yùn)氣不好型雳。
***如果你被困在起始黑屏***
恢復(fù)到目前為止我們所做的工作:
按CTRL + ALT + F2或CTRL + ALT + F3,使用您的密碼登錄。
Code:
apt-get remove --purge nvidia *
rm -rf /etc/X11/xorg.conf
刪除我們之前創(chuàng)建的那些顯示管理器文件(對(duì)于GDM):
Code:
rm -rf /usr/share/gdm/greeter/autostart/optimus.desktop
rm -rf /etc/xdg/autostart/optimus.desktop
現(xiàn)在重新啟動(dòng)纠俭。你應(yīng)該能夠回到舊系統(tǒng)沿量。
創(chuàng)作不易,希望能幫助喜歡kali的玩家