When install driver of NVIDIA graphics card, I get error

Hi All,

Graphic card: NVIDIA GTX 1070 for notebook
OS: OpenSUSE leap 42.3

I install the gcc and kernel-source by YAST. I download NVIDIA*.run file from official site, and blacklist the nouveau driver and reboot.

Then Ctrl+Alt+F1, init 3, ./NVIDIA*.run

I get error: The kernel header fiie ‘/usr/src/linux/include/linux/version.h’ does not exist. The most likely reason for this is that the kernel source files in ‘/use/src/linux’ have not been configured.

How to solve this problem?

Thanks.

Why don’t you use the precompiled drivers from the nvidia repo ?

Do you have the kernel-*devel packages installed?

Adding to the advice by Knurpht, if you insist on using the Nvidia .run file be aware that you have to uninstall the drm-kmp-default package first, then you need to install kernel-devel and kernel-default-devel, which carry the configuration needed by a standard install.
AFAIK the source packages as installed are not configured, so you need to provide a kernel configuration yourself.

Also note that likely your laptop is an “Optimus” system, so you need Bumblebee and simply installing the .run file is likely to bring you a lot of trouble.

Hi Knurpht,

After I install driver from nvidia repo and reboot. I got black screen.

I does not check kernel-debug-devel, kernel-source-vanilla and kernel-vanilla-devel. Are those neccessary?

Thanks.

After I install all kernel-*-devel packages, I verify by following command:

myname@linux1:/usr/src/linux/include/linux> ls|grep -i ver
average.h
dns_resolver.h
isdn_divertif.h
nvme-fc-driver.h
tty_driver.h
uio_driver.h
verify_pefile.h
vermagic.h
myname@linux1:/usr/src/linux/include/linux>

There is still no file version.h

Thanks

Hi
So I see you mention vanilla kernel?? Please post the output from;


uname -a

I did forget to uninstall drm-kmp-default package before installing kernel-*devel, I will try your advice.

How to provide kernel configuration myself? Could you talk it more?

And now I have drm-kmp-default, kernel-devel and kernel-default-devel installed, what should I do next? Should I uninstall these three packages and reinstall kernel-*devel? Or another option: reinstall OS?

Thanks

Here’s the output:

myname@linux1:/usr/src/linux/include/linux> uname -a
Linux linux1 4.4.76-1-default #1 SMP Fri Jul 14 08:48:13 UTC 2017 (9a2885c) x86_64 x86_64 x86_64 GNU/Linux
myname@linux1:/usr/src/linux/include/linux>

You say that this is a Optimus system. But I can not see my Intel Graphics card. I use following command:

sudo lspci|grep -i vga

01:00.0 VGA compatible controller: NVIDIA Corporation Device 1ba1 (rev a1)

##########################and###########################

following command:

sudo hwinfo --gfxcard
24: PCI 100.0: 0300 VGA compatible controller (VGA)
[Created at pci.378]
Unique ID: VCu0.5386mw9Nrf2
Parent ID: vSkL.rm7g6PCwW96
SysFS ID: /devices/pci0000:00/0000:00:01.0/0000:01:00.0
SysFS BusID: 0000:01:00.0
Hardware Class: graphics card
Model: “nVidia GP104M [GeForce GTX 1070 Mobile]”
Vendor: pci 0x10de “nVidia Corporation”
Device: pci 0x1ba1 “GP104M [GeForce GTX 1070 Mobile]”
SubVendor: pci 0x152d “QUANTA Computer Inc”
SubDevice: pci 0x1158
Revision: 0xa1
Driver: “nouveau”
Driver Modules: “drm”
Memory Range: 0xd2000000-0xd2ffffff (rw,non-prefetchable)
Memory Range: 0xc0000000-0xcfffffff (ro,non-prefetchable)
Memory Range: 0xd0000000-0xd1ffffff (ro,non-prefetchable)
I/O Ports: 0xd000-0xdfff (rw)
Memory Range: 0xd3000000-0xd307ffff (ro,non-prefetchable,disabled)
IRQ: 137 (10 events)
I/O Ports: 0x3c0-0x3df (rw)
Module Alias: “pci:v000010DEd00001BA1sv0000152Dsd00001158bc03sc00i00”
Driver Info #0:
Driver Status: nouveau is active
Driver Activation Cmd: “modprobe nouveau”
Config Status: cfg=new, avail=yes, need=no, active=unknown
Attached to: #8 (PCI bridge)

Primary display adapter: #24

Where is my intel graphics card info?

Thanks

On some systems it is possible to turn off the Intel GPU from the UEFI/BIOS, Most notebooks do not have that option though. So check the UEFI/BIOS settings

Hi
Is the system up to date, that is an old kernel, I would guess the development packages installed are for a later kernel. Make sure you system is all up to date first.


zypper if kernel-source

OK, one step at a time please. So apparently yours is one of the rare NON Optimus laptops and the standard Nvidia driver should work.
If you saw a black screen after installing the repo pre-packaged driver, see if this helps: https://forums.opensuse.org/showthread.php/528514-Blank-screen-with-NVIDIA-driver

If that doesn’t work, you do NOT need kernel sources to install the Nvidia driver “the hard way” with the .run installer, unless you are doing kernel development work (and so don’t need our help to configure it :wink: )
You are running the standard -default kernel, so NO need for kernel-vanilla or other flavors…
I have just the following installed here and the .run installer builds as intended:

bruno@LT_B:~> zypper se -i kernel-de
Loading repository data...
Reading installed packages...

S  | Name                 | Summary                                                 | Type   
---+----------------------+---------------------------------------------------------+--------
i+ | kernel-default       | The Standard Kernel                                     | package
i+ | kernel-default-devel | Development files necessary for building kernel modules | package
i+ | kernel-devel         | Development files needed for building kernel modules    | package
bruno@LT_B:~>

Better is to post:

zypper se -si kernel

So you can see more Details (Parameter -s) and only installed Packages (Parameter -i).

Also post:

zypper lr -d

Hi OrsoBruno,

Thanks for your help. The output of zypper is following:

myname@linux-1:~> zypper se -i kernel-de

S  | Name                 | Summary                                        | Type  
---+----------------------+---------------------------------------------+-------
i+ | kernel-debug-devel   | Development files necessary for building -> | package
i+ | kernel-default       | Standard Kernel                                    | package
i  | kernel-default-devel | Development files necessary for building -> | package
i  | kernel-devel         | Development files needed for building ker-> | package
myname@linux-1:~> 
myname@linux-1:~> zypper se -si kernel


S  | Name                  | Type   | Version         | Architecture   | repo                  
---+-----------------------+--------+--------------+--------+-------------------------
i+ | kernel-debug-devel    | package | 4.4.92-31.1  | x86_64 | openSUSE-42.3-Update-Oss
i+ | kernel-default        | package | 4.4.76-1.1   | x86_64 | openSUSE-42.3-Oss       
i  | kernel-default-devel  | package | 4.4.92-31.1  | x86_64 | openSUSE-42.3-Update-Oss
i  | kernel-devel          | package | 4.4.92-31.1  | noarch | openSUSE-42.3-Update-Oss
i  | kernel-firmware       | package | 20170530-9.1 | noarch | openSUSE-42.3-Oss       
i  | kernel-macros         | package | 4.4.92-31.1  | noarch | openSUSE-42.3-Update-Oss
i+ | kernel-source         | package | 4.4.92-31.1  | noarch | openSUSE-42.3-Update-Oss
i  | kernel-source-vanilla | package | 4.4.92-31.1  | noarch | openSUSE-42.3-Update-Oss
i+ | kernel-vanilla-devel  | package | 4.4.92-31.1  | x86_64 | openSUSE-42.3-Update-Oss
myname@linux-1:~> 
zypper lr -d


#  | Alias                         | Name                                    | Enabled | GPG check | Refresh | Priority | Type   | URI                                                                                            | Service
---+------------------------------+-----------------------------------------+--------+----------+------+--------+--------+------------------------------------------------------------------------------------------------+-----
 1 | aliyun-packman               | aliyun-packman                          | Yes     | (r ) Yes  | Yes   |   99   | rpm-md | http://mirrors.aliyun.com/packman/openSUSE_Leap_42.3/                                          |     
 2 | openSUSE-42.3-Non-Oss        | openSUSE-42.3-Non-Oss                   | Yes     | (r ) Yes  | Yes   |   99   | yast2  | http://mirrors.aliyun.com/opensuse/distribution/leap/42.3/repo/non-oss/                        |     
 3 | openSUSE-42.3-Oss            | openSUSE-42.3-Oss                       | Yes     | (r ) Yes  | Yes   |   99   | yast2  | http://mirrors.aliyun.com/opensuse/distribution/leap/42.3/repo/oss/                            |     
 4 | openSUSE-42.3-Update-Non-Oss | openSUSE-42.3-Update-Non-Oss            | Yes     | (r ) Yes  | Yes   |   99   | rpm-md | http://mirrors.aliyun.com/opensuse/update/leap/42.3/non-oss/                                   |     
 5 | openSUSE-42.3-Update-Oss     | openSUSE-42.3-Update-Oss                | Yes     | (r ) Yes  | Yes   |   99   | rpm-md | http://mirrors.aliyun.com/opensuse/update/leap/42.3/oss                                        |     
 6 | openSUSE-Leap-42.3-0         | openSUSE-Leap-42.3-0                    | No     | ----     | ---- |   99   | yast2  | hd:///?device=/dev/disk/by-id/usb-Kingston_DataTraveler_2.0_60A44C4138CCFE70A96923E8-0:0-part1 |     
 7 | repo-debug                   | openSUSE-Leap-42.3-Debug                | No     | ----     | ---- |   99   | NONE   | http://download.opensuse.org/debug/distribution/leap/42.3/repo/oss/                            |     
 8 | repo-debug-non-oss           | openSUSE-Leap-42.3-Debug-Non-Oss        | No     | ----     | ---- |   99   | NONE   | http://download.opensuse.org/debug/distribution/leap/42.3/repo/non-oss/                        |     
 9 | repo-debug-update            | openSUSE-Leap-42.3-Update-Debug         | No     | ----     | ---- |   99   | NONE   | http://download.opensuse.org/debug/update/leap/42.3/oss/                                       |     
10 | repo-debug-update-non-oss    | openSUSE-Leap-42.3-Update-Debug-Non-Oss | No     | ----     | ---- |   99   | NONE   | http://download.opensuse.org/debug/update/leap/42.3/non-oss/                                   |     
11 | repo-non-oss                 | openSUSE-Leap-42.3-Non-Oss              | No     | ----     | ---- |   99   | NONE   | http://download.opensuse.org/distribution/leap/42.3/repo/non-oss/                              |     
12 | repo-oss                     | openSUSE-Leap-42.3-Oss                  | No     | ----     | ---- |   99   | NONE   | http://download.opensuse.org/distribution/leap/42.3/repo/oss/                                  |     
13 | repo-source                  | openSUSE-Leap-42.3-Source               | No     | ----     | ---- |   99   | NONE   | http://download.opensuse.org/source/distribution/leap/42.3/repo/oss/                           |     
14 | repo-source-non-oss          | openSUSE-Leap-42.3-Source-Non-Oss       | No     | ----     | ---- |   99   | NONE   | http://download.opensuse.org/source/distribution/leap/42.3/repo/non-oss/                       |     
15 | repo-update                  | openSUSE-Leap-42.3-Update               | No     | ----     | ---- |   99   | NONE   | http://download.opensuse.org/update/leap/42.3/oss/                                             |     
16 | repo-update-non-oss          | openSUSE-Leap-42.3-Update-Non-Oss       | No    | ----     | ---- |   99   | NONE   | http://download.opensuse.org/update/leap/42.3/non-oss/                                         |     
myname@linux-1:~> 

Thanks

Is it necessary to uninstall drm-kmp-default? After I install the NVIDIA driver, if I install drm-kmp-default package again, whether get trouble?

Thanks

drm-kmp-default is NOT compatible with the Nvidia driver, so DO NOT re-install it after having installed Nvidia. It is better to check and uninstall drm-kmp-default before beginning the Nvidia installation, just to be sure that it is out of the way.

You have incompatible versions of the kernel packages in **bold **as already suggested by malcolmlewis.
Please update your kernel-default package first of all, it should match the -devel packages installed.

kernel-source kernel-source-vanilla kernel-vanilla-devel are not needed to install graphics drivers and may be uninstalled if you don’t need them for other purposes.

Hi,

I uninstalled drm-kmp-default, and updated kernel-default package to match -devel version. I uninstalled kernel-source package. Then reboot.

After login, I ctrl +alt +f1. Then login as root. I run init 3, then ./NVIDIA*.run. I accept all default configuration and successfully finished installation. Then I reboot, finally I see the black screen.

Is there any mistakes?

Thanks

Hi
If you press ctrl+alt+F1 do you get a console (tty) login?

Is there a /etc/modprobe.d/nvidia.conf with blacklist nouveau in it?

Is the nouveau still in use;


/sbin/lspci -nnk | grep -A3 VGA

If the blacklist exists but nouveau is in use, rebuild initrd as root user with;


mkinitrd

Hmmm… that might not expose the Nvidia card, just the Intel (if any). Try also:

/sbin/lspci -nnk | grep -A3 3D