You are not logged in.

#1 2020-09-01 14:46:51

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

[Solved] Applications cannot use Nvidia video card for display

This is a modern laptop -

$ lspci  | grep -i 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)

But it seems that no application can use the NVIDIA card for display. The utilization of this card is always 0%, and steam games warned me that I only have 512M video memory (GTX 1060 has 6G)

I have installed the drivers - nvidia and lib32-nvidia-utils

Here is my config file

$ cat /etc/X11/xorg.conf     
Section "ServerLayout"
        Identifier     "X.org Configured"
        Screen      0  "Screen0" 0 0
#       Screen      1  "Screen1" Right of "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"
        ### 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     "Accel"                     # [<bool>]
        #Option     "AccelMethod"               # <str>
        #Option     "Backlight"                 # <str>
        #Option     "CustomEDID"                # <str>
        #Option     "DRI"                       # <str>
        #Option     "Present"                   # [<bool>]
        #Option     "ColorKey"                  # <i>
        #Option     "VideoKey"                  # <i>
        #Option     "Tiling"                    # [<bool>]
        #Option     "LinearFramebuffer"         # [<bool>]
        #Option     "HWRotation"                # [<bool>]
        #Option     "VSync"                     # [<bool>]
        #Option     "PageFlip"                  # [<bool>]
        #Option     "SwapbuffersWait"           # [<bool>]
        #Option     "TripleBuffer"              # [<bool>]
        #Option     "XvPreferOverlay"           # [<bool>]
        #Option     "HotPlug"                   # [<bool>]
        #Option     "ReprobeOutputs"            # [<bool>]
        #Option     "XvMC"                      # [<bool>]
        #Option     "ZaphodHeads"               # <str>
        #Option     "VirtualHeads"              # <i>
        #Option     "TearFree"                  # [<bool>]
        #Option     "PerCrtcPixmaps"            # [<bool>]
        #Option     "FallbackDebug"             # [<bool>]
        #Option     "DebugFlushBatches"         # [<bool>]
        #Option     "DebugFlushCaches"          # [<bool>]
        #Option     "DebugWait"                 # [<bool>]
        #Option     "BufferCache"               # [<bool>]
        Identifier  "Card0"
        Driver      "intel"
        BusID       "PCI:0:2:0"
EndSection

Section "Device"
        Identifier  "Card1"
        Driver      "nvidia"
        BusID       "PCI:1:0: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

This is nearly the default config file.
You can see the line "#       Screen      1  "Screen1" Right of "Screen0"" and I only have one screen. If I leave this line there, I will get a strange display of the login screen- one is normal, and another is 1:2 of the normal size, appearing on the left top side of my screen.

And if I run

# nvidia-xconfig

as the wiki tells me, xorg will fail to start when I login. My screen will freeze and I can't do anything with tty1 again. So who can tell us how to write the right config file to enable the NVIDIA card or there's some other way to deal with the problem?

Last edited by Sffred (2020-09-02 11:22:49)

Offline

#2 2020-09-01 15:10:37

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,668

Re: [Solved] Applications cannot use Nvidia video card for display

Remove the xorg conf then read https://wiki.archlinux.org/index.php/NVIDIA_Optimus for the available options and decide for one.

Offline

#3 2020-09-02 11:22:02

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

Re: [Solved] Applications cannot use Nvidia video card for display

Thanks. I tried one of the instructions and now I can run programs with NVIDIA card by prime-run

Offline

#4 2020-09-06 15:26:42

fistrosan
Member
Registered: 2020-04-01
Posts: 171

Re: [Solved] Applications cannot use Nvidia video card for display

Sffr: how do you know which card in being used by Steam ? I am a Intel card and an Nvidia card. I switch to NVIDIA using optimus-manager but sometimes I get feeling that some games are still using Intel because it detects very low graphical settings ...

Offline

Board footer

Powered by FluxBB