You are not logged in.

#1 2020-11-21 03:09:14

Sffred
Member
Registered: 2020-08-30
Posts: 50

[SOLVED] Nvidia card fails-can't be detected by xrandr --listproviders

$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 630 (Mobile)
01:00.0 VGA compatible controller: NVIDIA Corporation GP106M [GeForce GTX 1060 Mobile] (rev a1)
$ xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x43 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 1 associated providers: 0 name:modesetting
$ nvidia-smi
Sat Nov 21 11:06:12 2020       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 455.38       Driver Version: 455.38       CUDA Version: 11.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce GTX 1060    Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   46C    P0    26W /  N/A |      0MiB /  6078MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+
$ ls /etc/X11
xdm xinit xorg.conf xorg.conf.d
$ cat /etc/X11/xorg.conf
Section "ServerLayout"
	Identifier     "X.org Configured"
	Screen      0  "Screen0" 0 0
#	Screen      1  "Screen1" RightOf "Screen0"
	InputDevice    "Mouse0" "CorePointer"
	InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
	ModulePath   "/usr/lib/xorg/modules"
	FontPath     "/usr/share/fonts/misc"
	FontPath     "/usr/share/fonts/TTF"
	FontPath     "/usr/share/fonts/OTF"
	FontPath     "/usr/share/fonts/Type1"
	FontPath     "/usr/share/fonts/100dpi"
	FontPath     "/usr/share/fonts/75dpi"
EndSection

Section "Module"
	Load  "glx"
EndSection

Section "InputDevice"
	Identifier  "Keyboard0"
	Driver      "kbd"
EndSection

Section "InputDevice"
	Identifier  "Mouse0"
	Driver      "mouse"
	Option	    "Protocol" "auto"
	Option	    "Device" "/dev/input/mice"
	Option	    "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
	Identifier   "Monitor0"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"
EndSection

Section "Monitor"
	Identifier   "Monitor1"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"
EndSection

Section "Device"
	Identifier  "Card1"
	Driver      "nvidia"
	BusID       "PCI:1:0:0"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "SWcursor"           	# [<bool>]
        #Option     "kmsdev"             	# <str>
        #Option     "ShadowFB"           	# [<bool>]
        #Option     "AccelMethod"        	# <str>
        #Option     "PageFlip"           	# [<bool>]
        #Option     "ZaphodHeads"        	# <str>
        #Option     "DoubleShadow"       	# [<bool>]
        #Option     "Atomic"             	# [<bool>]
	Identifier  "Card0"
	Driver      "modesetting"
	BusID       "PCI:0:2:0"
EndSection

Section "Screen"
	Identifier "Screen0"
	Device     "Card0"
	Monitor    "Monitor0"
	SubSection "Display"
		Viewport   0 0
		Depth     1
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
	EndSubSection
EndSection

Section "Screen"
	Identifier "Screen1"
	Device     "Card1"
	Monitor    "Monitor1"
	SubSection "Display"
		Viewport   0 0
		Depth     1
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
	EndSubSection
EndSection

$ cat /etc/X11/xorg.conf.d/20-nvidia.conf
Section "Device"
	Identifier "Nvidia Card"
	Driver "nvidia"
	VendorName "NVIDIA Corporation"
	BoardName "GeForce GTX 1060 Mobile"
EndSection

Section "ServerLayout"
	Identifier "layout"
	Option "AllowNVIDIAGPUScreens"
EndSection

Last edited by Sffred (2020-11-23 11:07:19)

Offline

#2 2020-11-21 08:10:36

seth
Member
Registered: 2012-09-03
Posts: 50,008

Re: [SOLVED] Nvidia card fails-can't be detected by xrandr --listproviders

Because you added an xorg.conf (originally probably written by nvidia-settings) that explicitly selects a screen that selects a device that's you intel chip.
Get rid of that file and read up https://wiki.archlinux.org/index.php/NVIDIA_Optimus and configure the system as you intend to use it.

Online

#3 2020-11-21 08:36:31

Sffred
Member
Registered: 2020-08-30
Posts: 50

Re: [SOLVED] Nvidia card fails-can't be detected by xrandr --listproviders

Well, this xorg.conf is produced by

# Xorg :0 -configure

and I commented the Screen 1 row to avoid a second display being printed on my screen. Although I still can't figure out what I should do to configure NVIDIA Optimus, you remained me to regenerate the configure and now my machine works fine. Thanks a lot.

Offline

#4 2020-11-21 09:35:50

Sffred
Member
Registered: 2020-08-30
Posts: 50

Re: [SOLVED] Nvidia card fails-can't be detected by xrandr --listproviders

I found out what happened:
xdm seems to start too soon so that nvidia card cannot be used. If I restart xdm.service then nvidia card will be recognized.

Offline

#5 2020-11-21 09:57:36

seth
Member
Registered: 2012-09-03
Posts: 50,008

Re: [SOLVED] Nvidia card fails-can't be detected by xrandr --listproviders

https://wiki.archlinux.org/index.php/NV … de_setting
In particular also add the modules to the initramfs-

You'll still have to configure the optimus system, the config you're now likely using creates a multiscreen setup where one screen is drien by nvidia and the other one by the intel chip and you cannot move windows inbetween.

Online

#6 2020-11-23 05:35:01

Sffred
Member
Registered: 2020-08-30
Posts: 50

Re: [SOLVED] Nvidia card fails-can't be detected by xrandr --listproviders

Thanks for your recommendation. However I just get confused by the configuration provided by the wiki. I have no idea about where to start. I have been using prime-run script so far- when I need to run an application using the NVIDIA card, I run it with prime-run.

Offline

#7 2020-11-23 06:06:21

seth
Member
Registered: 2012-09-03
Posts: 50,008

Re: [SOLVED] Nvidia card fails-can't be detected by xrandr --listproviders

https://wiki.archlinux.org/index.php/Ke … _KMS_start but for the nvidia modules
https://wiki.archlinux.org/index.php/Mkinitcpio to re-create the image
https://wiki.archlinux.org/index.php/Kernel_parameters to add the nvidia-drm.modeset=1 parameter

https://wiki.archlinux.org/index.php/PR … er_offload
You probably want to use https://wiki.archlinux.org/index.php/PR … erse_PRIME to get access to the outputs of the nvidia chip

nb. that the examples refer the radeon driver (for AMD cards) and some random outputs names - do not copy and paste blue boxes…

Online

#8 2020-11-23 09:20:37

Sffred
Member
Registered: 2020-08-30
Posts: 50

Re: [SOLVED] Nvidia card fails-can't be detected by xrandr --listproviders

Thank you. I think I got it right. What I did:

modify /etc/mkinitcpio.conf, adding "nvidia" in the line MODULES=()
add pacman hook about nvidia and run # mkinitcpio -P
add the nvidia-drm.modeset=1 parameter in the file /etc/default/grub and regenerate the grub.cfg file with # grub-mkconfig -o /boot/grub/grub.cfg

Now I can safely use a display manager (e.g. xdm), and the nvidia card works fine immediately after powering on the machine.
For stuff relates with primer offload, the wiki reads, "Also, starting from Xorg 1.20.7, the Xorg configuration is not needed anymore, since the needed options are already present on the driver directly. ". prime-run scripts just works fine with me. It seems that I don't need to do anything to configure it. What do you mean by "to get access to the outputs of the nvidia chip"? I have already got it.

Last edited by Sffred (2020-11-23 09:51:01)

Offline

Board footer

Powered by FluxBB