Unable to remove opensuse nvidia driver

Hello.
I am testing suse-prime, and bumblebee on a test laptop.
Optimus ASUS g750JZ

My question is just how to remove any nvidia piece of software so that I can say that the nvidia driver is removed.

The current situation is :

  • suse-prime has been removed

  • bbswitch has been removed

  • bumblebee has been removed

  • nvidia-computeG04 has been removed

  • nvidia-gfxG04-kmp-default has been removed

  • nvidia-glG04 has been removed

  • x11-video-nvidiaG04 has been removed

  • Mesa-dri-nouveau is installed

  • libdrm_nouveau2 is installed

  • libdrm_nouveau2-32bit is installed

  • libvdpau_nouveau is installed

  • xf86-video-nouveau is installed

  • kernel boot parameter is : GRUB_CMDLINE_LINUX_DEFAULT=“resume=/dev/disk/by-label/LNX_SWAP showopts elevator=deadline ipv6.disable=1 plymouth.enable=0 nomodeset”

  • command ‘grub2-mkconfig -o /boot/grub2/grub.cfg’ has been run
  • command ‘mkinitrd’ has been run

After rebooting it seems that some nvidia modules are still in used

localhost:~ sudo  modprobe -r nvidia
modprobe: FATAL: Module nvidia is in use.

Here after is a list of some commands relative to graphics.

[sudo] password for root: 
.
.
----------------
.
 - 1 - lsmod | grep -i nvidia
.
----------------

nvidia_drm             45056  0
nvidia_modeset       1056768  1 nvidia_drm
nvidia              14671872  1 nvidia_modeset
drm_kms_helper        204800  2 i915,nvidia_drm
drm                   491520  4 i915,nvidia_drm,drm_kms_helper
ipmi_msghandler        65536  2 nvidia,ipmi_devintf

.
.
----------------
.
 - 2 - lshw -c video
.
----------------

  *-display                 
       description: 3D controller
       product: GK104M [GeForce GTX 880M]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:16 memory:ec000000-ecffffff memory:c0000000-cfffffff memory:d0000000-d1ffffff ioport:e000(size=128) memory:ed000000-ed07ffff
  *-display UNCLAIMED
       description: VGA compatible controller
       product: Crystal Well Integrated Graphics Controller
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 08
       width: 64 bits
       clock: 33MHz
       capabilities: msi pm vga_controller bus_master cap_list
       configuration: latency=0
       resources: memory:ed400000-ed7fffff memory:80000000-8fffffff ioport:f000(size=64) memory:c0000-dffff

.
.
----------------
.
 - 3 - modinfo -F filename : echo "lshw -c video | awk '/configuration: driver/{print }' | cut -d= -f2"
.                           
----------------

modinfo -F filename nvidia
/lib/modules/4.12.14-lp151.28.20-default/updates/nvidia.ko

.
.
----------------
.
 - 4 - modinfo $(modprobe --resolve-alias nvidia)
.
----------------

filename:       /lib/modules/4.12.14-lp151.28.20-default/updates/nvidia.ko
alias:          char-major-195-*
version:        390.129
supported:      external
license:        NVIDIA
suserelease:    openSUSE Leap 15.1
srcversion:     C9CBE920F0195665AFA8A5C
alias:          pci:v000010DEd00000E00sv*sd*bc04sc80i00*
alias:          pci:v000010DEd*sv*sd*bc03sc02i00*
alias:          pci:v000010DEd*sv*sd*bc03sc00i00*
depends:        ipmi_msghandler
retpoline:      Y
vermagic:       4.12.14-lp151.28.20-default SMP mod_unload modversions 
parm:           NVreg_Mobile:int
parm:           NVreg_ResmanDebugLevel:int
parm:           NVreg_RmLogonRC:int
parm:           NVreg_ModifyDeviceFiles:int
parm:           NVreg_DeviceFileUID:int
parm:           NVreg_DeviceFileGID:int
parm:           NVreg_DeviceFileMode:int
parm:           NVreg_UpdateMemoryTypes:int
parm:           NVreg_InitializeSystemMemoryAllocations:int
parm:           NVreg_UsePageAttributeTable:int
parm:           NVreg_MapRegistersEarly:int
parm:           NVreg_RegisterForACPIEvents:int
parm:           NVreg_CheckPCIConfigSpace:int
parm:           NVreg_EnablePCIeGen3:int
parm:           NVreg_EnableMSI:int
parm:           NVreg_TCEBypassMode:int
parm:           NVreg_UseThreadedInterrupts:int
parm:           NVreg_EnableStreamMemOPs:int
parm:           NVreg_EnableBacklightHandler:int
parm:           NVreg_RestrictProfilingToAdminUsers:int
parm:           NVreg_EnableUserNUMAManagement:int
parm:           NVreg_EnableIBMNPURelaxedOrderingMode:int
parm:           NVreg_MemoryPoolSize:int
parm:           NVreg_KMallocHeapMaxSize:int
parm:           NVreg_VMallocHeapMaxSize:int
parm:           NVreg_IgnoreMMIOCheck:int
parm:           NVreg_RegistryDwords:charp
parm:           NVreg_RegistryDwordsPerDevice:charp
parm:           NVreg_RmMsg:charp
parm:           NVreg_AssignGpus:charp

.
.
----------------
.
 - 5 - lspci -nnk | grep -e NVIDIA -e VGA -A2
.
----------------

00:02.0 VGA compatible controller [0300]: Intel Corporation Crystal Well Integrated Graphics Controller [8086:0d26] (rev 08)
        Subsystem: ASUSTeK Computer Inc. Device [1043:157d]
        Kernel modules: i915
--
01:00.0 3D controller [0302]: NVIDIA Corporation GK104M [GeForce GTX 880M] [10de:1198] (rev a1)
        Subsystem: ASUSTeK Computer Inc. Device [1043:157d]
        Kernel driver in use: nvidia
.
.
----------------
.
 - 6 - hwinfo --gfxcard
.
----------------

14: PCI 02.0: 0300 VGA compatible controller (VGA)              
  [Created at pci.386]
  Unique ID: _Znp.T0yuS2eFrPD
  SysFS ID: /devices/pci0000:00/0000:00:02.0
  SysFS BusID: 0000:00:02.0
  Hardware Class: graphics card
  Model: "Intel Crystal Well Integrated Graphics Controller"
  Vendor: pci 0x8086 "Intel Corporation"
  Device: pci 0x0d26 "Crystal Well Integrated Graphics Controller"
  SubVendor: pci 0x1043 "ASUSTeK Computer Inc."
  SubDevice: pci 0x157d 
  Revision: 0x08
  Memory Range: 0xed400000-0xed7fffff (rw,non-prefetchable)
  Memory Range: 0x80000000-0x8fffffff (ro,non-prefetchable)
  I/O Ports: 0xf000-0xf03f (rw)
  Memory Range: 0x000c0000-0x000dffff (rw,non-prefetchable,disabled)
  IRQ: 255 (no events)
  Module Alias: "pci:v00008086d00000D26sv00001043sd0000157Dbc03sc00i00"
  Driver Info #0:
    Driver Status: i915 is active
    Driver Activation Cmd: "modprobe i915"
  Config Status: cfg=new, avail=yes, need=no, active=unknown

24: PCI 100.0: 0302 3D controller
  [Created at pci.386]
  Unique ID: VCu0.MfCj7rI+fJ6
  Parent ID: vSkL.V_RmGycvUj1
  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 GK104M [GeForce GTX 880M]"
  Vendor: pci 0x10de "nVidia Corporation"
  Device: pci 0x1198 "GK104M [GeForce GTX 880M]"
  SubVendor: pci 0x1043 "ASUSTeK Computer Inc."
  SubDevice: pci 0x157d 
  Revision: 0xa1
  Driver: "nvidia"
  Driver Modules: "nvidia"
  Memory Range: 0xec000000-0xecffffff (rw,non-prefetchable)
  Memory Range: 0xc0000000-0xcfffffff (ro,non-prefetchable)
  Memory Range: 0xd0000000-0xd1ffffff (ro,non-prefetchable)
  I/O Ports: 0xe000-0xefff (rw)
  Memory Range: 0xed000000-0xed07ffff (ro,non-prefetchable,disabled)
  IRQ: 16 (29 events)
  Module Alias: "pci:v000010DEd00001198sv00001043sd0000157Dbc03sc02i00"
  Driver Info #0:
    Driver Status: nouveau is not active
    Driver Activation Cmd: "modprobe nouveau"
  Driver Info #1:
    Driver Status: nvidia_drm is active
    Driver Activation Cmd: "modprobe nvidia_drm"
  Driver Info #2:
    Driver Status: nvidia is active
    Driver Activation Cmd: "modprobe nvidia"
  Config Status: cfg=new, avail=yes, need=no, active=unknown
  Attached to: #22 (PCI bridge)

Primary display adapter: #14

.
.
----------------
.
 - 7 - xrandr --listproviders
.
----------------

xrandr: Failed to get size of gamma for output default
Providers: number : 0

.
.

There is still a nvidia module in : /lib/modules/4.12.14-lp151.28.20-default/updates/nvidia.ko

In this situation, I would like to have only the intel driver in use.
To get that I have to add the following parameter in the kernel boot parameter :

module_blacklist=nvidia,nvidia-current,nvidia_drm,nvidia_uvm,nvidia_modeset

Any help is welcome.

Did you recreate initrd after removing nvidia? Just run mkinitrd.

I can say that without changing anything more I have run :

  • command ‘grub2-mkconfig -o /boot/grub2/grub.cfg’
  • command ‘mkinitrd’
  • command ‘grub2-mkconfig -o /boot/grub2/grub.cfg’
  • command ‘mkinitrd’

I must add that I have removed dkms.
So perhaps this is the reason why a nvidia module is still there : /lib/modules/4.12.14-lp151.28.20-default/updates/nvidia.ko

Don’t forget to eradicate nomodeset. Kernel ModeSetting is a foundation for FOSS DDX usage with both Intel and NVidia GPUs, so disabling it prevents an acceptably performing pure FOSS installation.

Showopts is inert, so you might as well remove it too.

Presently I just want to boot only with the intel graphic driver.
I will enable nouveau later

I hope it is possible ?

It may depend on what you mean by “the”. The kernel and X both use hardware “drivers”. For both Intel and NVidia GPUs, respectable X performance from FOSS depends on their respective (i915 and nouveau) kernel drivers providing (Kernel Mode Setting) functionality. Both Intel and NVidia GPUs have two X drivers (DDX) to choose from. The older technology, specific to each, are provided by xf86-video-intel and xf86-video-nouveau. The newer technology (modesetting DDX) works for both, and is provided by the server package.

Unless you override it by blacklisting or a kernel cmdline option, the kernel loads its KMS drivers automatically according to the GPUs it finds. X will do essentially the same thing, load an appropriate DDX for each it finds. As long as one of the older technology is available, it will be loaded. Otherwise, the newer technology will be loaded. If you don’t like this behavior, you can utilize configuration options in /etc/X11/xorg.conf* to override it. So, you can disable, but you don’t “enable”, as enabling is the default behavior.

OK now can we focus to my question post #1 and my answer to arvidjaar post #3.

To your question “… how to remove any nvidia piece of software so that I can say that the nvidia driver is removed …” i can only be of little help. If you installed the NVIDIA driver

  • using the NVIDIA .run package from the NVIDIA internet using the uninstall switch of that package should remove all files.
  • from the openSUSE repository using yast or zypper to uninstall the package should remove all files.

As far as your wish “Presently I just want to boot only with the intel graphic driver.” is concerned i recommend the following:

Create the files

/etc/modprobe.d/09-modprobe_nvidia_blacklist.conf” with

blacklist nvidia
blacklist nvidia-drm
blacklist nvidia-modeset
blacklist nouveau

/etc/X11/xorg.conf.d/20-xorg_intel_kms.conf” with

Section “Device”
Identifier “intel_kernel_driver”
Driver “modesetting”
BusID “PCI:00:02:0”
EndSection

and make sure that your kernel command line does not contain “nomodeset”.

This should make sure that your system starts up using the intel graphics card.

Regards

susejunky

1 - nomodeset - tells the kernel to not start video drivers until the system is up and running.
That as nothing to do with the intel graphics card but with all graphic cards.

2 - Yast should have remove every things as I said in my post # 1 ( I mean that zypper se -s nvidia … show nothing ) but it seems that is not sufficient.

  • suse-prime has been removed
  • bbswitch has been removed
  • bumblebee has been removed
  • nvidia-computeG04 has been removed
  • nvidia-gfxG04-kmp-default has been removed
  • nvidia-glG04 has been removed
  • x11-video-nvidiaG04 has been removed

I have discover that there are some nvidia*.ko files in /lib/modules/4.12.14-lp151.28.20-default.
So adding

module_blacklist=nvidia,nvidia-current,nvidia_drm,nvidia_uvm,nvidia_modeset

to the kernel cmdline options prevent nvidia driver to load.

So where that nvidia files come from. ?

Hi
Is that the latest running kernel? If you installed via the rpm method then left-overs (I don’t use the rpm method) because it can’t remove them if you using it…

To uninstall properly, need to be at runlevel 3 (multi-user.target) and then use YaST ncurses or zypper to remove.

That’s not what nomodeset does.

What is does is disable Kernel Mode Setting, on which good FOSS X drivers (xf86-video-amdgpu, xf86-video-intel, xf86-video-nouveau, xf86-video-ati) depend, so that they never load on the current boot. The generic X drivers (xf86-video-fbdev and xf86-video-vesa) don’t use KMS, so one of them usually will load, X performance will be low, and available modes may not include the display’s preferred mode.

So be it!
That prevent nouveau to be loaded.
And that does not answer my question in thread #1.

So, you want to remove all files belonging to the once installed proprietary NVIDIA driver (i do not understand why but so it be).

I don’t know what went wrong (which files are still left over, etc.) when you tried this the first time. So the only advice i can offer is:

  1. install the driver again the same way (.run or from repository) you did it the last time
  2. keep a record of all files which get installed
  3. switch to target “multi-user.target”
  4. remove the driver either with zypper, yast or using the uninstall-option of the .run file
  5. rebuild your initrd file
  6. reboot your system and make sure not to use the “nomodeset” kernel parameter (even if you are so fond of it)
  7. if there are still files left remove them manually by using the record you kept in 2.)
  8. rebuild your initrd
  9. reboot your system

Good luck.

Regards

susejunky

We can only speculate. You don’t say how these have been “removed”. Removal can only be expected to work properly by precisely following the instructions that accompanied the installation. If those cannot be conformed to, or otherwise fail, the only way I know should work is a fresh installation.

What might work is to use the verify option of rpm on the Mesa and other X packages to locate any any file inconsistent with a fresh installation, but it seems a fresh installation would be simpler that determining all packages which would need to be verified.

Hi,
Just out of curiousity, do you have anything related to nvidia still showing up under rpm? Does anything show up following this?

sudo rpm -qa |grep -i nvidia

I have discover that “bbswitch-kmp-default” was not removed when removing bumblebee and bbswitch.

Now after removing “bbswitch-kmp-default” they do not appear any more.
And now nvidia driver has disappear.
Is it possible that “bbswitch-kmp-default” is able to reconstruct the nvidia driver modules ?

I think my main mistake was to remove the opensuse nvidia driver not in init 3 mode as said by malcolmlewis.nvidia driver

I thought that it was only mandatory when removing proprietary driver ( known as the hard-way ).

No , now that I have removed “bbswitch-kmp-default” the nvidia driver has completely disappear.

I use to use the proprietary nvidia driver and i use the hard-way install.
I never go into problem.

This times as I am trying bumblebee and all the stuff, I used the nvidia*G0x driver family.
I made a mistake thinking that the uninstall procedure was different from the hard-way procedure.

I think that was my mistake.

As I was using the opensuse driver ( nvidia*G04 ) I have only use zypper to install/remove all the stuff ( nvidia, bbswitch, bumblebee )
and I did not saw that a “bbswitch-kmp-default” package was used.
I use very few “nomodeset” kernel parameter. Only when necessary.