Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Problem installing nvidia drivers

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
phaedo7
Posts: 7
Joined: 2018-11-04 19:36

Problem installing nvidia drivers

#1 Post by phaedo7 »

I am trying to install nvidia drivers for my debian 9 stretch. I have followed the instructions on debian wiki. I have also tried couple of youtube tutorials. I dont get any problems during installation. Its only after reboot. On rebooting I am stuck with error which says:

Code: Select all

[FAILED] Failed to start Load Kernel Modules
See 'systemctl status systemd-modules-load.service' for details
I have tried following a lot of tutorials for nvidia drivers including debian wiki. But regardless what I do, I always get this error and I, without any choice, have to reinstall debian. Also, when this error occurs, I try doing stuff in recovery mode. But I cannot do much since I dont have internet access in recovery mode.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Problem installing nvidia drivers

#2 Post by Head_on_a_Stick »

phaedo7 wrote:the instructions on debian wiki
^ This should work, please post the *exact* method that you used so that we can see where you went wrong (we're not psychic).

Also, have you actually tried nouveau? I hear it is very good these days :)

EDIT: don't follow YouTube videos, they are made by idiots for idiots (generally speaking).
deadbang

phaedo7
Posts: 7
Joined: 2018-11-04 19:36

Re: Problem installing nvidia drivers

#3 Post by phaedo7 »

I tried lots of different things but ended up with same problem. But here are the general steps I followed after installing debian:

1. Edited sources.list using

Code: Select all

nano /etc/apt/sources.list
by adding contrib non-free after every "main"

2.

Code: Select all

sudo apt-get update
and

Code: Select all

sudo apt-get upgrade
3.

Code: Select all

apt-get install nvidia-detect
and detected my graphics card

4.

Code: Select all

dpkg --add-architecture i386
and

Code: Select all

apt-get install libavcodec-extra
(from youtube tutorial)

5.

Code: Select all

apt-get install firmware-linux-nonfree
and

Code: Select all

apt-get install firmware-linux
6. Step 5 gave me warnings that I miss some firmware, so I googled it and found a solution. I used:

Code: Select all

sudo apt install firmware-misc-nonfree firmware-netxen firmware-realtek
sudo update-initramfs -u
sudo apt-cache policy firmware-linux-nonfree
sudo apt-get install firmware-linux-nonfree
sudo apt-get update
7.

Code: Select all

sudo apt-get install linux-headers-$(uname -r|sed 's/[^-]*-[^-]*-//')
8.

Code: Select all

sudo apt-get install nvidia-settings nvidia-driver nvidia-opencl-common
I have also tried

Code: Select all

apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') nvidia-driver

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: Problem installing nvidia drivers

#4 Post by stevepusser »

Code: Select all
apt-get install libavcodec-extra

(from youtube tutorial)
Yeah...libavcodec has zip, nada, nothing at all to do with Nvidia drivers. That only reinforces HOAS's comment about the YT videos. Even funnier/sadder are the Kali videos.

Maybe it's something to do with your hardware setup. Can you install inxi and report the output of (as a standard user, NOT with sudo or as root)

Code: Select all

inxi -G
?
MX Linux packager and developer

phaedo7
Posts: 7
Joined: 2018-11-04 19:36

Re: Problem installing nvidia drivers

#5 Post by phaedo7 »

This is output I get after

Code: Select all

inxi -G

Code: Select all

Graphics:  Card-1: Intel HD Graphics 5500
           Card-2: NVIDIA GM108M [GeForce 940M]
           Display Server: X.Org 1.19.2 drivers: modesetting,nouveau (unloaded: fbdev,vesa)
           Resolution: 1920x1080@60.05hz
           GLX Renderer: Mesa DRI Intel HD Graphics 5500 (Broadwell GT2)
           GLX Version: 3.0 Mesa 13.0.6

User avatar
piper
Posts: 102
Joined: 2005-07-03 08:29

Re: Problem installing nvidia drivers

#6 Post by piper »

Enable [non-free] in sources if you haven't already, since you tried installing nvidia-driver already, your better off starting from scratch

You can skip this if already done

Code: Select all

dpkg --add-architecture i386

Code: Select all

apt update
make sure you include the period

Code: Select all

apt purge nvidia.

Code: Select all

apt update; apt install nvidia-driver nvidia-driver-libs nvidia-settings nvidia-kernel-dkms
Reboot

Edit:: You have an Intel video card also, so the above won't work, I will leave the post for others to benefit, I don't know what shape bumblebee is in nowadays or even if it still works

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: Problem installing nvidia drivers

#7 Post by stevepusser »

OK, your Intel card is handling the display, so when you told the system to use the Nvidia card for display--black screen. Just to make sure, is this a laptop you're using?
If it's a desktop, can you disable the integrated Intel GPU in the UEFI/BIOS setup?

Another, easier to remember way to make sure your system is prepared to build kernel modules (like Nvidia) is to install module-assistant and run as root or with sudo:

Code: Select all

m-a prepare
and I didn't even have to make a video about that tip. :roll:
MX Linux packager and developer

phaedo7
Posts: 7
Joined: 2018-11-04 19:36

Re: Problem installing nvidia drivers

#8 Post by phaedo7 »

I installed module assistant and did m-a prepare. After that I installed the headers and Nvidia drivers as instructed in Debian wiki. After reboot, finally, didn't get the error of Failed to start Load Kernel Module. However this time I ran into another problem. Now the system doesn't boot and it gets stuck on a message which looks like

Code: Select all

/dev/sda2: clean ...... files, .......blocks
sda2 is where my ext4 file system is loaded.

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: Problem installing nvidia drivers

#9 Post by stevepusser »

Is this a laptop (second try)?

Better yet, give us the result of

Code: Select all

inxi -Fxz
MX Linux packager and developer

phaedo7
Posts: 7
Joined: 2018-11-04 19:36

Re: Problem installing nvidia drivers

#10 Post by phaedo7 »

It is a laptop(my bad). Here is the output: https://imgur.com/a/Nt5Ljwm

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: Problem installing nvidia drivers

#11 Post by stevepusser »

OK, that's what I thought. You have Optimus, and you must follow the procedure in the wiki for setting up Bumblee instead of just installing the Nvidia drivers if you want to keep the power savings this affords.

https://wiki.debian.org/NvidiaGraphicsDrivers/Optimus
MX Linux packager and developer

phaedo7
Posts: 7
Joined: 2018-11-04 19:36

Re: Problem installing nvidia drivers

#12 Post by phaedo7 »

Just to be sure. Do I still need module assistant for setting Nvidia drivers via bumblebee ?

Thanks advance

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Problem installing nvidia drivers

#13 Post by Head_on_a_Stick »

phaedo7 wrote:Do I still need module assistant for setting Nvidia drivers via bumblebee ?
Only if you want to use the proprietary drivers, nouveau doesn't need the headers and will work with Bumblebee.
deadbang

phaedo7
Posts: 7
Joined: 2018-11-04 19:36

Re: Problem installing nvidia drivers

#14 Post by phaedo7 »

Basically, let me boil down to this. I want to use my GPU for using tensorflow and other deep learning stuff that uses GPU. Given this you can suggest me the best thing for it.

Thank you again

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Problem installing nvidia drivers

#15 Post by Head_on_a_Stick »

CUDA needs the blob, if that's what you mean.

If you need to run non-free software then Debian probably isn't the best choice, IMO.
deadbang

Post Reply