Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Nvidia + Intel + i3 - blank screen (laptop)
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
HawkDeath
n00b
n00b


Joined: 20 Jul 2021
Posts: 3

PostPosted: Tue Jul 20, 2021 11:50 am    Post subject: Nvidia + Intel + i3 - blank screen (laptop) Reply with quote

Hi,

I'm having trouble getting the display to correctly redirect to the internal monitor. After starting i3 (startx command) the screen is redirected to HDMI output and not to the internal monitor.
I have no idea how to properly debug this. I am not very familiar with the X server. I suspect I am missing an entry on the internal monitor. Unfortunately, I don't know where or what entry I should add.
Anybody have idea where is the problem???

.xinitrc
Code:
exec dbus-launch --sh-syntax --exit-with-session i3

lspci:
Code:
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 630 (Mobile)
01:00.0 VGA compatible controller: NVIDIA Corporation TU116M [GeForce GTX 1660 Ti Mobile] (rev a1)


xorg.conf
Code:
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 460.67


Section "ServerLayout"

#   Screen      1  "Screen1" RightOf "Screen0"
    Identifier     "X.org Configured"
    Screen      0  "Screen0" 0 0
    InputDevice    "Mouse0" "CorePointer"
    InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
    ModulePath      "/usr/lib64/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           "glxserver_nvidia"
    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     "ZaphodHeads"           # <str>
        #Option     "VirtualHeads"          # <i>
        #Option     "TearFree"              # [<bool>]
        #Option     "PerCrtcPixmaps"        # [<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"
    DefaultDepth    24
    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         "Card0"
    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

Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Tue Jul 20, 2021 12:24 pm    Post subject: Reply with quote

There are many different hardware configurations for laptops with dual graphics, with Intel and nVidia it may be Optimus. Is yours Optimus?
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
HawkDeath
n00b
n00b


Joined: 20 Jul 2021
Posts: 3

PostPosted: Tue Jul 20, 2021 2:13 pm    Post subject: Reply with quote

That was Optimus. Rewriting xorg.conf from this website http://us.download.nvidia.com/XFree86/Linux-x86_64/346.22/README/randr14.html and add this two lines to .xinitrc
Code:
$ xrandr --setprovideroutputsource modesetting NVIDIA-0
$ xrandr --auto

helped.

Thanks for pointing out where the problem might lie. :D
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21635

PostPosted: Tue Jul 20, 2021 3:46 pm    Post subject: Reply with quote

With those changes, is your problem fully solved? If so, please mark your thread as solved.

Also, for the benefit of future readers, could you show the rewritten xorg.conf that worked for you, so that readers can compare to see what was needed (in case that nVidia link goes dead, or is unclear)?
Back to top
View user's profile Send private message
HawkDeath
n00b
n00b


Joined: 20 Jul 2021
Posts: 3

PostPosted: Tue Jul 20, 2021 6:02 pm    Post subject: Reply with quote

Yes, those changes fully solved my problem. I had installed the proper drivers, but I have an incorrect X server configuration.
Below you can see the configuration files that I had to change.

.xinitrc
Code:
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
exec dbus-launch --sh-syntax --exit-with-session i3


xorg.conf
Code:
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 460.67

Section "ServerLayout"
    Identifier     "layout"
    Screen      0 "nvidia"
    Inactive "intel"
    InputDevice    "Mouse0" "CorePointer"
    InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
    ModulePath      "/usr/lib64/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           "glxserver_nvidia"
    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 "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:1:0:0"
EndSection

Section "Screen"
    Identifier     "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration"
EndSection

Section "Device"
    Identifier     "intel"
    Driver         "modesetting"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection


And also I forgot to show my make.conf file
Code:
VIDEO_CARDS="nvidia intel i965 iris"
USE="-kde -gnome -systemd -wayland -consolekit elogind dbus X pulseaudio alsa dist-kernel driver static-libs tools"
ACCEPT_LICENSE="*"
COMMON_FLAGS="-march=native -O2 -pipe"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum