#________________________________________________



How to install nvidia driver on linux



in green : to type as command
in blue: to add in files with text editor
#________________________________________________

for intense use prevent computer from sleeping

# sources.list==> where to find on the web the linux packages
type :

xedit /etc/apt/sources.list

#-----------------------lines to add in sources.list
# comment the line for cd rom
------------------------------------------- should be like that

#deb cdrom:[Debian GNU/Linux 12.1.0 _Bookworm_ - Official amd64 DVD Binary-1 with firmware 20230722-10:49]/ bookworm main non-free-firmware

deb http://deb.debian.org/debian/ bookworm main non-free-firmware
deb-src http://deb.debian.org/debian/ bookworm main non-free-firmware

deb http://security.debian.org/debian-security bookworm-security main non-free-firmware
deb-src http://security.debian.org/debian-security bookworm-security main non-free-firmware

# bookworm-updates, to get updates before a point release is made;
# see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports

-------------------------------------------------------------------------------------
# and add the lines for nvidia driver

deb http://deb.debian.org/debian/ bookworm-updates main non-free-firmware
deb-src http://deb.debian.org/debian/ bookworm-updates main non-free-firmware

deb http://deb.debian.org/debian/ buster main contrib non-free
deb-src http://deb.debian.org/debian/ buster main contrib non-free

deb http://security.debian.org/debian-security buster/updates main contrib non-free
deb-src http://security.debian.org/debian-security buster/updates main contrib non-free

deb http://deb.debian.org/debian/ buster-updates main contrib non-free
deb-src http://deb.debian.org/debian/ buster-updates main contrib non-free

___________________________________________________________________________________________

apt-get install gedit
apt update
apt install nvidia-detect
nvidia-detect
apt-get -y install dkms
apt-get update
apt-get -y install pciutils
lspci | grep VGA

#----- should find the graphics card
# nvidia driver installation needs to add modules or components to the kernel
# so it needs a compilation environement
#---------

apt-get install build-essential
apt-get upgrade
apt-get install manpages-dev
gcc --version
apt install git
apt install linux-headers-$(uname -r)
ls -l /usr/src/linux-headers-$(uname -r)
#--- checked if kernel headers where on drive
apt-get update
apt install build-essential<
apt-get install manpages-dev
sudo apt-get -y install dkms
apt-get upgrade
dkms add
apt -y install linux-headers-$(uname -r) build-essential libglvnd-dev pkg-config
apt update
apt-get install software-properties-gtk
apt update
apt-get install software-properties-qt
apt-get install synaptic
apt update
apt-get install software-properties-qt

#-----------------------------------------------------------
#use software&updates to add non free and contrib to sources.list<
#--------------------/etc/apt/sources.list content----------------------
_______________________________________________________________________________

# deb cdrom:[Debian GNU/Linux 12.1.0 _Bookworm_ - Official amd64 DVD Binary-1 with firmware 20230722-10:49]/ bookworm main non-free-firmware
deb http://deb.debian.org/debian/ bookworm main non-free-firmware contrib non-free
deb-src http://deb.debian.org/debian/ bookworm main non-free-firmware contrib non-free<
deb http://security.debian.org/debian-security bookworm-security main non-free-firmware contrib non-free
deb-src http://security.debian.org/debian-security bookworm-security main non-free-firmware contrib non-free
# bookworm-updates, to get updates before a point release is made;
# see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports
deb http://deb.debian.org/debian/ bookworm-updates main non-free-firmware contrib non-free
deb-src http://deb.debian.org/debian/ bookworm-updates main non-free-firmware contrib non-free
deb http://deb.debian.org/debian/ buster main contrib non-free<
deb-src http://deb.debian.org/debian/ buster main contrib non-free
deb http://security.debian.org/debian-security buster/updates main contrib non-free
deb-src http://security.debian.org/debian-security buster/updates main contrib non-free
deb http://deb.debian.org/debian/ buster-updates main contrib non-free
deb-src http://deb.debian.org/debian/ buster-updates main contrib non-free
______________________________________________________________________________________

apt update

#---------------------------------------------------
# reisntall nvidia-detect until it recommend which driver to install

apt install nvidia-detect
apt update
nvidia-detect

#nvidia-detect recommends nvidia-tesla-470-driver

sudo apt install nvidia-tesla-470-driver

#------ then reboot

systemCtl reboot

#--------- there is no gdm and it is impossible to access a graphic desktop at login
# with Ctrl Alt F2 log in console mode

apt-get install nvidia-config<
nvidia-config

#------ check /var/log/xcong.log.0
# there was a message about acpid deamon not running
# open /etc/X11/xorg.conf done with nvidia-config
# go to driver section and add line

# Option "ConnectToAcpid" "0" and save

apt-get install gdm3

#___________________________ should work_____________________________________

run clinfo to check if nvidia is working the right way
might be missing the vendor /etc/OpenCL/vendors

apt-get install clinfo
apt-get update
clinfo
apt-get install -y nvidia-tesla-470-opencl-icd
apt-get install update

------------------------------------------------------------------
links
------------------------------------------------------------------
https://www.cyberciti.biz/faq/ubuntu-linux-install-nvidia-driver-latest-proprietary-driver/