【问题解决】【linux的双显示器无法识别的问题】【HDMI-1-1 disconnected (normal left inverted right x axis y axis)】

@[TOC](【问题解决】【linux的双显示器无法识别的问题】【HDMI-1-1 disconnected (normal left inverted right x axis y axis)】)

0 前言

1 问题描述

  • 我先描述一下我的问题
  1. 我的nvdia已经安装,使用nvidia-smi命令是可以查看信息的
  2. 只使用HDMI线连接一个显示屏,无论是核显还是集显都没有问题,可以正常显示
  3. 只要插上两个HDMI线,连接两个显示屏,只有一个显示屏可以用
  4. 就算我使用xrandr 命令,可以看到只有一个显示屏连接,另一个显示屏根本就没有连接
  • 做出的尝试
  1. 我尝试重装了nvidia,没用
  2. 我甚至照着官网装了cuda

2 问题解决

  • 直到我看到了一篇文章,就是参考文章,要看/etc/X11/xorg.conf文件,但是我一看我没有这个文件,本着死猪不怕开水烫,就自己创建一个了,还真可以

2.1 前提步骤问题检验

1.笔记本ubuntu 16.04系统无法检测双屏,xrandr不显示hdmi接口或hdmi disconnectted,我是这样
2.nvidia-smi的最下方显示No running processes found,我也是这样
3.nvidia-settings显示ERROR: Unable to load info from any available system 或 nvidia-settings能够运行但是无法检测到独立显卡,也无法切换独显,这个我不一样,我提示(nvidia-settings:3158): GLib-GObject-CRITICAL **: 15:43:44.501: g_object_unref: assertion 'G_IS_OBJECT (object)' failed 有文章说这个错误不用管,只需要确保nvidia-smi,可以打开就可以

2.2 解决

  1. 首先看一看自己有没有/etc/X11/xorg.conf,没有的话,自己创建一个,如果有的话,建议在替换之前先将自己的xorg.conf先备份一份,如替换后有问题可以再改回来。,没有的自然也无从备份
sudo touch /etc/X11/xorg.conf
sudo gedit /etc/X11/xorg.conf

把下面内容加进去:

Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"
EndSection

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

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

Section "Device"
    Identifier "intel"
    Driver "modesetting"
    BusID  "PCI:0:2:0"
    Option  "AccelMethod"  "sna"
    Option "TearFree" "True"
    Option "Tiling"   "True"
    Option "SwapbuffersWait" "True"
EndSection

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

Section "Files"
EndSection
  1. 保存之后重启电脑,即可解决

3 参考

猜你喜欢

转载自blog.csdn.net/qq_45954434/article/details/126347856