Upload
todorovic-miodrag
View
216
Download
0
Embed Size (px)
Citation preview
8/11/2019 Debian and Nvidia Drivers
1/18
* NvidiaGraphicsDrivers
This document explains how to make use of NVIDIA video hardware on a Debian GNU!inuxs"stem# The free drivers onl" provides $D acceleration% whereas the non&free drivers supports'D&acceleration#
(ontents
)# free drivers $# non&free drivers )# h" use a Debian&specific method+ )# (omparison of nvidia&installer and the Debian wa" $# Installation )# Tar,et audience $# -verview )# (urrent issues '# .teps )# Install the kernel module )# .tock or (ustom /ernel+ $# !e,ac" drivers+
'# 0ethods )# Use module&assistant $# Use module&assistant 1lenn"2 '# Install a pre&built module 3# 4uild manuall"% with a custom kernel 5# 4uild manuall"% with a stock kernel $# Install the NVIDIA user&space libraries '# (onfi,ure 6 to use the nvidia driver )# The debconf wa" $# The manual wa" 3# 7orce the kernel module to load at boot 3# !oad the kernel module and restart 6 )# (heck that it worked
'# 8ow to deal with kernel chan,es and driver up,rades )# hen )# ###will the NVIDIA driver version chan,e $# ###will "our kernel chan,e '# Troubleshootin, )# 6 doesn9t start $# !ost :our (onsole '# Trouble with !inux $#; 3# 6 1or the complete machine when runnin, 62 is unstable 5# 8ardware acceleration% aka direct renderin,% doesn9t work ;# 'D Applications Abortin, with # .ome old ,ame doesn9t start
?#
8/11/2019 Debian and Nvidia Drivers
2/18
most VGA cards# The nv driver usuall" ,ives better results# To see which is installed read theoutput of
,rep Driver etc6))67>;(onfi,&3 etc6))xor,#conf $BC),rep 9nvEvesa9
To switch between drivers% see
8/11/2019 Debian and Nvidia Drivers
3/18
*
Jas" to use# 14ut users who often rebuild their kernel mi,ht ,et tired of rerunnin, it ever" time&& rebuildin, a kernel reMuires waitin, throu,h a reboot% watchin, the now incompatible old 6server to die% navi,atin, the installer menus% then startin, 6# It ,ets old# That9s wh" this ,uide waswritten# 2 2 * .ome users report that when the Debian wa" fails% the NVIDIA installer works#
Installation
The Debian wa" to install the NVIDIA 'D drivers#
Tar,et audience
Debian users runnin, !inux kernel versions $#3 or $#;% with either stock or custom kernels% andwith .ar,e or Jtch#
-verview
The NVIDIA 'D drivers have two parts a kernel module% and a collection of user&space G!6
libraries# The kernel module or
8/11/2019 Debian and Nvidia Drivers
4/18
skip to the followin, section#
4" default% Debian comes with a stock kernel# If "ou don9t know what kind of kernel "ou9rerunnin,% then it9s probabl" a stock kernel# If "ou9re not sure% run
uname &r
and check if the output looks like $#*#*&small number&architecture 1e#,# $#3#$=&$&'>; or $#;#>&$&k=2# If it does% "ou9re most likel" runnin, a stock kernel#
!e,ac" drivers+
Debian 3#@% or Jtch% 1released in $@@=2% has separate packa,es for older nvidia card driversFthese packa,es all have @ 6G!% OuadroNV. 5@ (I% Ge7orce$ Inte,rated GU% Ge7orce3 06 Inte,rated GU% Ge7orce'% Ge7orce' Ti$@@% Ge7orce' Ti 5@@% Ouadro D((% Ge7orce3 Ti 3;@@ Ge7orce3 Ti 33@@% Ge7orce3 Ti 3$@@%Ouadro3 ?@@ 6G!% Ouadro3 =5@ 6G!% Ouadro3 =@@ 6G!% Ge7orce3 Ti 3>@@% Ge7orce3 Ti 3$@@with AG>6% Ge7orce3 Ti 3>@@ .J% Ge7orce3 3$@@ Go% Ouadro3 ?>@ 6G!% Ouadro3 =>@ 6G!%and Ouadro3 =@@ GoG!#
Use current drivers if possible# .upported cards in Jtch are listed in Appendix A of NVIDIA9s )#@&>==; driver JAD0J b" NVIDIA chip name and Device (I ID# .upported cards in post&Jtchversions of Debian Unstable 1
8/11/2019 Debian and Nvidia Drivers
5/18
Install module&assistant% ,cc% and nvidia&kernel&common with with apt&,et
P apt&,et install module&assistant ,cc nvidia&kernel&common
Then run
P m&a update
and
P m&a prepare
un the followin, command% but substitute nvidia b" nvidia&kernel&le,ac"&source if "ou want toinstall the le,ac" drivers - nvidia&kernel&le,ac"&66xx if "ou are usin, .id replacin, 66xx one ofthe packa,es listed here#
P m&a auto&install nvidia
And that9s it# If all went well% "our nvidia kernel module is now built and installedF "ou ma"
proceed to step $# If not% read the rest of this section#
:ou must use the same version of ,cc to build "our nvidia kernel module as was used to build"our kernel# This mi,ht be a problem if "ou are runnin, a stock kernel# If module&assistant fails%read its lo, output and look for messa,es su,,estin, that "ou need% for example% ,cc&3#@ insteadof ,cc&3#)# Then install the correspondin, packa,e and retr" auto&install#
The auto&install step is the bi,,est step of the procedure% and is the most likel" to fail# auto&installcan be divided in smaller module&assistant steps% which can help debu,,in,
*
,et
*
build *
install
If P m&a ,et nvidiaF fails% tr" installin, the nvidia&kernel&source packa,e# If AT fails to installnvidia&kernel&source% "ou should ,o back to step @ and make sure "ou didn9t miss somethin,#
If "ou are unable to install the module usin, module&assistant% tr" installin, a pre&built module if"ou use a stock kernel or tr" to build manuall"% with a custom kernel#
Use module&assistant 1lenn"2
This should be an updated ,uide to the above section which applies to lenn"# && Andres0eHia Tue%)@ Qun $@@> $@)=@; &@3@@
7irst "ou9ll need to edit "our sources#list file to use the contrib and non&free section of the archive#
nano etcaptsources#list
Jdit the file so that it contains this snippet
8/11/2019 Debian and Nvidia Drivers
6/18
deb httpftp#Rcountr"ScodeB#debian#or,debian lenn" main contrib non&freedeb&src httpftp#Rcountr"ScodeB#debian#or,debian lenn" main contrib non&free
deb httpsecurit"#debian#or, lenn"updates main contrib non&freedeb&src httpsecurit"#debian#or, lenn"updates main contrib non&free
-nce "ou9ve updated the sources#list file% update#
apt&,et update
Now "ou9ll need to install some needed packa,es# (urrentl"% two packa,es have to be manuall"downloaded from the archive as the" have not entered testin, "et#
apt&,et install module&assistant nvidia&kernel&common nvidia&xconfi, cd tmp w,et &c httpftp#Rcountr"ScodeB#debian#or,debianpoolnon&freennvidia&,raphics&driversnvidia&kernel&sourceSRversionBSRarchB#deb w,et &c httpftp#Rcountr"ScodeB#debian#or,debianpoolnon&freennvidia&,raphics&driversnvidia&,lxSRversionBSRarchB#deb
dpk, &i *#deb apt&,et &f install
N-TJ The last step is Hust a Muick wa" to satisf" the dependencies of the manuall" downloadedpacka,es% since the next to last step will fail because of missin, dependencies#
Now ,o into the usrsrc director" and extract the nvidia&kernel tarball#
cd usrsrc tar &xHf nvidia&kernel#tar#b$
Now "ou9re read" to use the module&assistant tools to build the drivers#
m&a update m&a &&non&inter prepare m&a auto&install nvidia
N-TJ m&a prepare will install for "ou some necessar" packa,es like ,cc and the linux&kernel&headers appropriate for "our s"stem#
:ou should now have an nvidia&kernel&R1uname &r2B packa,e installed in "our s"stem# (heck b"usin, this command#
dpk, &s nvidia&kernel&1uname &r2
Now update "our xor,#conf file usin, nvidia&xconfi,#
nvidia&xconfi,
N-TJ Usin, nvidia&xconfi, for the first time will probabl" ,ive "ou an error such as this#
VA!IDATI-N J- Data incomplete in file etc6))xor,#conf# Device section
8/11/2019 Debian and Nvidia Drivers
7/18
Install a pre&built module
This method is eas" if "ou9re runnin, a recent stock kernel for which a pre&built module isavailableF it will not work at all if "ou9re runnin, a custom kernel or Debian '#) amd;3# If themodule&assistant method doesn9t work for "ou and there are pre&built modules available for "ourkernel% use this method#
In .ar,e% pre&built modules are onl" available for kernel $#3#$=% .ar,e9s default kernel# There areno pre&built modules for $#;#># If "ou don9t know "our kernel version% run
uname &r
If there is a pre&built module for "our kernel% install its packa,e# The name starts with
8/11/2019 Debian and Nvidia Drivers
8/18
*
Device drivers B Graphics support B VJ.A VGA ,raphics support 174SVJ.A2 *
rocessor T"pe and 7eatures B !ocal AI( support on uniprocessors 16>;SUSAI(2 1notavailable if "ou have an .0 kernel% includin, h"perthreadin,2
It is therefore recommended that "ou disable all of the above options in "our kernel confi,uration#If for some reason "ou don9t disable them% and then "our 6 displa" doesn9t work properl" with thenvidia driver% "ou should suspect these options as the likel" cause of the trouble# 7or moredetails% see the Troubleshootin, section#
'# 4uild the kernel and the nvidia kernel module
cd usrsrclinuxP make&kpk, cleanP make&kpk, kernelSima,e modulesSima,e
7or an introduction to usin, make&kpk, to build kernel packa,es% see (reatin, custom kernels
with Debian9s kernel&packa,e s"stem% or (ompilin, /ernels the Debian a"# .ee also the make&kpk, man pa,e% for a description of other options and tar,ets that "ou can use in this command#
The result of the above command will be two Debian packa,e files% kernel linux W&ima,e&*#deband nvidia&kernel&*#deb% both in usrsrc or usrsrcmodules# The first file contains "our kernel%and the second contains "our nvidia kernel module#
At the same time% if "ou have sources for an" other add&on kernel modules in usrsrcmodules%then the
8/11/2019 Debian and Nvidia Drivers
9/18
)# .ave the release number of "our kernel 1e#,# $#3#$=&$&k= or $#;#>&)&;>;2 in a couple ofenvironment variables
export /VJ.X1uname &r2 export /.(Xusrsrclinux&headers&/VJ.
* Note that these variables are used b" the build commands below% so "ou reall" do need to setand export them% as in the above commands#
)# Install the kernel module source run
apt&,et install nvidia&kernel&source nvidia&kernel&common
* This will ,ive "ou a source tarball usrsrcnvidia&kernel&source#tar#,# Unpack it with
cd usrsrc tar &xf nvidia&kernel&source#tar#,
* This will unpack the kernel module sources into usrsrcmodulesnvidia&kernel#
)# Install the header files for "our kernel
apt&,et install linux&headers&/VJ.
* This will ,ive "ou kernel header files in usrsrclinux&headers&/VJ.# 4e sure to check thatthe installed kernel ima,e and kernel header packa,es have the same version number run
apt&cache polic" kernel&ima,e&/VJ. linux&headers&/VJ.
* and check that the version number listed as Installed is the same for both packa,es# If it isn9t%find the distribution that has the version of linux&headers that "ou need% e#,# testin,% and rerun theabove installation command% addin, 9&t testin,9 1or whichever2#
)# 4uild the kernel module packa,e
cd usrsrcmodulesnvidia&kernel debianrules binar"Smodules
* The result will be a packa,e file usrsrcnvidia&kernel&*#deb% which contains "our kernelmodule# Note several users have told me recentl" that their nvidia packa,e file ends up inusrsrcmodules% instead of usrsrc# I don9t know "et wh" this happens# If this is "our case%please adHust the next command appropriatel"#
)# Install the kernel module
dpk, &i usrsrcnvidia&kernel&*#deb
* Use the file,lob as above if "ou want% but watch out that "ou don9t have more than one nvidia&kernel packa,e file l"in, around in usrsrc# If "ou do "ou9ll ,et a bliard of error messa,es# It9sprobabl" better to explicitl" t"pe all of the version information that I rendered as * above#
* Now proceed to step $% below#
Install the NVIDIA user&space libraries
8/11/2019 Debian and Nvidia Drivers
10/18
Install the nvidia&,lx packa,e for the current drivers% or nvidia&,lx&le,ac" if "ou want to install thele,ac" drivers# 7or example% to install the current drivers with apt&,et
P apt&,et install nvidia&,lx
Note The reason this step has to come after step ) is that nvidia&,lx depends on a virtualpacka,e called 9nvidia&kernel&NVVJ.I-N9% where NVVJ.I-N is the upstream part of theversion of the nvidia&,lx packa,e# This virtual packa,e should be provided b" the kernel modulepacka,e that "ou installed in step )F so "ou have to complete that step first# If the installation ofnvidia&,lx fails because the 9nvidia&kernel&NVVJ.I-N9 isn9t satisfied% "ou should probabl"make sure that step ) went -/#
(onfi,ure 6 to use the nvidia driver
Update "our 6 confi,uration# There are two wa"s to do this# The one "ou should use depends onwhether "ou manuall" edited "our 6 confi,uration file# If "ou don9t know if "ou did% "ou probabl"didn9t# If "ou run .ar,e and choose the debconf wa" but "ou did edit "our 6 confi, file% "ourchan,es will be Muietl" i,nored# To make sure% run one of the followin, commands% dependin, on"our 6 server#
7or 67ree>; 1.ar,e2
md5sum etc6))67>;(onfi,&3diff &sM varlibxfree>;67>;(onfi,&3#md5sum &
7or 6#or, 1Jtch2
md5sum etc6))xor,#confdiff &sM varlibx))xor,#conf#md5sum &
If the files differ% choose the second wa" 1the manual wa"2#
As a su,,estion% save "ourself some possible ,rief later b" backin, up "our current 6 confi, file#7or 67ree>; 1.ar,e2
P cp &p etc6))67>;(onfi,&3 etc6))67>;(onfi,&3#bak
7or 6#or, 1Jtch2
P cp &p etc6))xor,#conf etc6))xor,#conf#bak
The debconf wa"
un the followin, command# 7or 67ree>; 1.ar,e2
P dpk,&reconfi,ure xserver&xfree>;
7or 6#or, 1Jtch2
P dpk,&reconfi,ure xserver&xor,
This will ask "ou a lon, series of Muestions% some of which "ou should have alread" seen at leastwhen "ou installed Debian# :ou onl" need to chan,e "our answer to $ of those Muestions# henasked to choose an 6 server driver% choose nvidia# Then% when asked to select 6 server modules%deselect 1uncheck2 G!(ore 1if present2 and dri% and select 1check2 ,lx#
7inall"% if "ou use .ar,e% "ou ma" want to verif" that "our 6 confi, file was written# To do so% run
8/11/2019 Debian and Nvidia Drivers
11/18
ls &l etc6))67>;(onfi,&3
and check that the date printed is current# If this is not the case% "ou9ll have to use the manualwa"# -therwise% "our 6 confi,uration should have been updated for the use of the nvidia driver#
The manual wa"
This method will allow "ou to preserve customiations "ou9ve made to "our 6 confi, file# Jtchusers should simpl" install and use nvidia&xconfi,# The rest of this section is for .ar,e users#
atch out for t"pos% and check "our 6 lo, if thin,s ,o wron,#
Jdit "our 6 confi, file
* In the
8/11/2019 Debian and Nvidia Drivers
12/18
If "ou can9t f i,ure out how to restart 6 with those instructions% "ou can simpl" reboot "our s"stem#-therwise% the ke"board shortcut (trlZAltZ4ackspace should be reliable% despite bein, somewhat
8/11/2019 Debian and Nvidia Drivers
13/18
have to install the kernel&ima,e&$#3#$=&'&'>; packa,e to ,et the new kernel 1the
8/11/2019 Debian and Nvidia Drivers
14/18
8/11/2019 Debian and Nvidia Drivers
15/18
If "ou happen to lose "our virtual terminals 1(trlZAltZ7)2 Ki#e# the console is displa"in, ,arba,eLafter xor, starts% this mi,ht be a fix 1it was for me2
P apt&,et install nvidia&settin,s nvidia&settin,sclick -penG! .ettin,s and check
8/11/2019 Debian and Nvidia Drivers
16/18
shuttin, down their 6 servers% until the" recompiled their kernels with local AI( disabled# !ocalAI( support on uniprocessors 16>;SUSAI(2 is enabled in stock non&.0 kernels# Note thatthe local AI( option isn9t available if "ou have an .0 1e#,# h"perthreadin,2 kernel# In that casethe local AI( option probabl" has no effect% but one user reported that he still had successdisablin, it b" manuall" editin, usrsrclinux#confi, to comment out the line with(-N7IGS6>;S!-(A!SAI(# 8e also had to repeat the operation ever" time he reconfi,ured hiskernel# Alternativel"% "ou mi,ht have to turn off .0 and then disable local AI(# 1
8ardware acceleration% aka direct renderin,% doesn9t work
e9ve covered how to check that the installation worked in section
8/11/2019 Debian and Nvidia Drivers
17/18
If some software 1probabl" old ,ames2 complains about missin, libG!#so% tr" installin, nvidia&,lx&dev# If this doesn9t help% this application is probabl" bu,," or doesn9t support "our s"stem# Thisdocument probabl" can9t help "ou with these problems#
8/11/2019 Debian and Nvidia Drivers
18/18