首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Ubuntu 20.04睡眠后失去监视器分辨率

Ubuntu 20.04睡眠后失去监视器分辨率
EN

Ask Ubuntu用户
提问于 2021-12-06 07:46:13
回答 1查看 961关注 0票数 2

我有一个Nvidia RTX 3070和三星C49RG90显示器。监视器通过HDMI连接到视频卡。一切正常,除非我挂起系统,然后把它唤醒。当发生这种情况时,分辨率将更改为1024x768。我可以登录并打开Nvidia控制面板,并将其设置为正确的分辨率,但是如果我再次让它进入睡眠状态,分辨率总是返回到1024x768。

我使用的是Nvidia驱动程序的470.86版本,但旧版本的行为方式相同。

当我在wake之后手动设置分辨率,然后运行xrandr时,我得到如下结果:

代码语言:javascript
复制
Screen 0: minimum 8 x 8, current 5120 x 1440, maximum 32767 x 32767
HDMI-0 connected primary 5120x1440+0+0 (normal left inverted right x axis y axis) 1mm x 1mm
   3840x1080     59.97 +
   5120x1440     59.98*   29.98  
   3840x2160     59.94    50.00    29.97    25.00    23.98  
   2560x1440     59.95  
   2560x1080     60.00    59.94  
   1920x1080     60.00    59.94    50.00  
   1680x1050     59.95  
   1600x900      60.00  
   1440x900      59.89  
   1280x1024     75.02    60.02  
   1280x800      59.81  
   1280x720      60.00    59.94    50.00  
   1152x864      75.00  
   1024x768      75.03    70.07    60.00  
   800x600       75.00    72.19    60.32    56.25  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    72.81    59.94  
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)
DP-5 disconnected (normal left inverted right x axis y axis)

当我让机器进入睡眠状态,然后再次唤醒它,然后运行xrandr时,我得到这样的结果:

代码语言:javascript
复制
Screen 0: minimum 8 x 8, current 5120 x 1440, maximum 32767 x 32767
HDMI-0 connected primary 1024x768+3327+362 (normal left inverted right x axis y axis) 0mm x 0mm panning 5120x1440+0+0
   3840x1080     59.97 +
   5120x1440     59.98    29.98  
   3840x2160     59.94    50.00    29.97    25.00    23.98  
   2560x1440     59.95  
   2560x1080     60.00    59.94  
   1920x1080     60.00    59.94    50.00  
   1680x1050     59.95  
   1600x900      60.00  
   1440x900      59.89  
   1280x1024     75.02    60.02  
   1280x800      59.81  
   1280x720      60.00    59.94    50.00  
   1152x864      75.00  
   1024x768      75.03    70.07    60.00  
   800x600       75.00    72.19    60.32    56.25  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    72.81    59.94  
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)
DP-5 disconnected (normal left inverted right x axis y axis)
  1024x768 (0x208) 94.500MHz +HSync +VSync
        h: width  1024 start 1072 end 1168 total 1376 skew    0 clock  68.68KHz
        v: height  768 start  769 end  772 total  808           clock  85.00Hz

这是我的xorg.conf文件:

代码语言:javascript
复制
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 470.57.01

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "Module"
    Load           "dbe"
    Load           "extmod"
    Load           "type1"
    Load           "freetype"
    Load           "glx"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Samsung C49RG9x"
    HorizSync       30.0 - 160.0
    VertRefresh     24.0 - 120.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "NVIDIA GeForce RTX 3070"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-0"
    Option         "metamodes" "5120x1440 +0+0; 800x600 +0+0; 640x480 +0+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

我知道可能需要更多的信息,但我不知道该去哪里找。

EN

回答 1

Ask Ubuntu用户

发布于 2023-01-08 14:04:44

经过几年的偶尔戳,我相信我已经解决了这个问题。

首先,Nvidia论坛上的这个问题与我的问题几乎完全相同。和这个问题的作者一样,我认为问题的根源在于我的监视器在睡眠中醒来时没有提供EDID信息,这导致Ubuntu选择默认的1024x768分辨率。

为了解决这个问题,我导出了描述为这里的EDID。我将文件保存为ASCII,并将其命名为crg-edit.txt,然后将其移动到/etc/X11。但是,我没有运行“从文件加载显示EDID”部分中的命令。相反,我手动打开了我的/etc/X11/xorg.conf文件并对其进行了编辑(参见配置中的注释):

代码语言:javascript
复制
Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-0"
    Option         "CustomEDID" "GPU-0.HDMI-0:/etc/X11/crg-edid.txt" # I added this line
    Option         "metamodes" "5120x1440 +0+0" # I removed the 1024x768 option from here
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

在这些步骤之后,监视器将以3840x1080的更高分辨率从挂起返回,但仍然不是我的目标分辨率5120x1440。因此,我运行了xrandr --verbose,并指出,出于某种原因,该决议是可取的:

代码语言:javascript
复制
...
  3840x1080 (0x1be) 266.500MHz +HSync -VSync +preferred
        h: width  3840 start 3888 end 3920 total 4000 skew    0 clock  66.62KHz
        v: height 1080 start 1083 end 1093 total 1111           clock  59.97Hz
  5120x1440 (0x1bf) 469.000MHz +HSync -VSync *current
        h: width  5120 start 5168 end 5200 total 5280 skew    0 clock  88.83KHz
        v: height 1440 start 1443 end 1453 total 1481           clock  59.98Hz
...

环顾四周后,我发现了的问题。然后我再次编辑了我的xorg.conf,如下所示:

代码语言:javascript
复制
Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Samsung C49RG9x"
    HorizSync       30.0 - 160.0
    VertRefresh     24.0 - 120.0
    Option         "DPMS"
    Option         "PreferredMode" "5120x1440" # I added this line
EndSection

代码语言:javascript
复制
Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-0"
    Option         "CustomEDID" "GPU-0.HDMI-0:/etc/X11/crg-edid.txt"
    Option         "metamodes" "5120x1440 +0+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Virtual     5120 1440 # I added this line
        Depth       24
    EndSubSection
EndSection

我不确定是否需要自定义EDID和其他设置,我也不在乎,因为它正在工作,我想让它单独使用。但我想分享我的发现,以防它对其他人有帮助。

编辑:当我安装Ubuntu22.04时,我经历了这个过程,它运行得很好。请注意,在完成这些步骤后首次登录后,屏幕默认为3840x1080。我使用Ubuntu控制面板将分辨率更改为5120x1440,并通过重新启动和挂起保持该设置。

票数 1
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1379465

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档