Which NVIDIA driver to install for Tensorflow?

I’m running Manjaro-stable, with all the packages up to date. And I have a NVDIA 940MX and a Intel HD Graphics 620 installed.

Here’s what lscpi -v gave me:

GPU details
01:00.0 3D controller: NVIDIA Corporation GM108M [GeForce 940MX] (rev a2)
	DeviceName: NVIDIA N16S-GTR
	Subsystem: Hewlett-Packard Company Device 8216
	Flags: bus master, fast devsel, latency 0, IRQ 134
	Memory at b3000000 (32-bit, non-prefetchable) [size=16M]
	Memory at a0000000 (64-bit, prefetchable) [size=256M]
	Memory at b0000000 (64-bit, prefetchable) [size=32M]
	I/O ports at 4000 [size=128]
	Expansion ROM at <ignored> [disabled]
	Capabilities: [60] Power Management version 3
	Capabilities: [68] MSI: Enable+ Count=1/1 Maskable- 64bit+
	Capabilities: [78] Express Endpoint, MSI 00
	Capabilities: [100] Virtual Channel
	Capabilities: [250] Latency Tolerance Reporting
	Capabilities: [258] L1 PM Substates
	Capabilities: [128] Power Budgeting <?>
	Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
	Capabilities: [900] Secondary PCI Express
	Kernel driver in use: nouveau
	Kernel modules: nouveau, nvidia_drm, nvidia

00:02.0 VGA compatible controller: Intel Corporation HD Graphics 620 (rev 02) (prog-if 00 [VGA controller])
	DeviceName: Intel Kabylake HD Graphics ULT GT2
	Subsystem: Hewlett-Packard Company Device 8216
	Flags: bus master, fast devsel, latency 0, IRQ 132
	Memory at b2000000 (64-bit, non-prefetchable) [size=16M]
	Memory at c0000000 (64-bit, prefetchable) [size=256M]
	I/O ports at 5000 [size=64]
	Expansion ROM at 000c0000 [virtual] [disabled] [size=128K]
	Capabilities: [40] Vendor Specific Information: Len=0c <?>
	Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00
	Capabilities: [ac] MSI: Enable+ Count=1/1 Maskable- 64bit-
	Capabilities: [d0] Power Management version 2
	Capabilities: [100] Process Address Space ID (PASID)
	Capabilities: [200] Address Translation Service (ATS)
	Capabilities: [300] Page Request Interface (PRI)
	Kernel driver in use: i915
	Kernel modules: i915

prime-run glxinfo | grep renderer gives me the following output:

 X Error of failed request:  BadValue (integer parameter out of range for operation)
      Major opcode of failed request:  153 (GLX)
      Minor opcode of failed request:  24 (X_GLXCreateNewContext)
      Value in failed request:  0x0
      Serial number of failed request:  39
      Current serial number in output stream:  40

However, DRI_PRIME="1" glxinfo|egrep "OpenGL vendor|OpenGL renderer" gives me:

OpenGL vendor string: nouveau
OpenGL renderer string: NV118

And, glxinfo|egrep "OpenGL vendor|OpenGL renderer" gives me:

OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) HD Graphics 620 (KBL GT2)

I ran DRI_PRIME="1" hardinfo and selected the ‘GPU benchmark’ option. It had run the benchmark using the Intel card.

When I try to run nvidia-settings:

ERROR: NVIDIA driver is not loaded
ERROR: Unable to load info from any available system

What can I do to make the NVIDIA card function properly and to take over GPU-intensive processes from the Intel card?

can you report

inxi -Fza 
Graphics:  Device-1: Intel HD Graphics 620 vendor: Hewlett-Packard driver: i915 v: kernel bus-ID: 00:02.0 chip-ID: 8086:5916 
           class-ID: 0300 
           Device-2: NVIDIA GM108M [GeForce 940MX] vendor: Hewlett-Packard driver: nvidia v: 460.67 
           alternate: nouveau,nvidia_drm bus-ID: 01:00.0 chip-ID: 10de:134d class-ID: 0302 
           Device-3: Cheng Uei Precision Industry (Foxlink) HP Wide Vision HD integrated webcam type: USB driver: uvcvideo 
           bus-ID: 1-3:3 chip-ID: 05c8:038e class-ID: 0e02 serial: <filter> 
           Display: server: X.org 1.20.11 compositor: gnome-shell driver: loaded: intel,nouveau unloaded: modesetting 
           alternate: fbdev,nv,vesa resolution: <missing: xdpyinfo> 
           OpenGL: renderer: Mesa Intel HD Graphics 620 (KBL GT2) v: 4.6 Mesa 21.0.1 direct render: Yes

can you add xdpyinfo?

sudo pacman -S xdpyinfo
inxi -Gxx

I could only find xorg-xdpyinfo. And that packages provides xdpyinfo. The output for inxi -Gxx:

Graphics:  Device-1: Intel HD Graphics 620 vendor: Hewlett-Packard driver: i915 v: kernel bus-ID: 00:02.0 chip-ID: 8086:5916 
           Device-2: NVIDIA GM108M [GeForce 940MX] vendor: Hewlett-Packard driver: nvidia v: 460.67 bus-ID: 01:00.0 
           chip-ID: 10de:134d 
           Device-3: Cheng Uei Precision Industry (Foxlink) HP Wide Vision HD integrated webcam type: USB driver: uvcvideo 
           bus-ID: 1-3:3 chip-ID: 05c8:038e 
           Display: x11 server: X.Org 1.20.11 compositor: gnome-shell driver: loaded: intel,nouveau unloaded: modesetting 
           alternate: fbdev,nv,vesa resolution: 1366x768~60Hz s-dpi: 96 
           OpenGL: renderer: Mesa Intel HD Graphics 620 (KBL GT2) v: 4.6 Mesa 21.0.1 direct render: Yes

you have installed free drivers ,
open a tty [ Ctrl+Alt +F2 to F7 ) , and quit gnome ( end session gnome )

sudo mhwd -a pci nonfree 0300

then reboot

I did it, and it said Skipping already installed config 'video-hybrid-intel-nvidia-prime' for device: 0000:00:02.0 (0300:8086:5916) Display controller Intel Corporation HD Graphics 620. I then uninstalled video-linux just out of a hunch and restarted.
Now what?

now you have lost drivers intel for Xorg
so to correct this do this in TTY

sudo mhwd -a pci free 0300
sudo mhwd -a pci nonfree 0300

check with prime command

Actually, I dunno what happened, but everything is working fine after I did that. Tensorflow is using NVIDIA GPU and there seems to be no errors, at least for the example code I’m running. Thanks for all the help :slight_smile:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.