AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 735172
Accepted
Emre Talha
Emre Talha
Asked: 2023-02-12 06:43:00 +0800 CST2023-02-12 06:43:00 +0800 CST 2023-02-12 06:43:00 +0800 CST

Gnome 因 VFIO gpu 直通而挂起

  • 772

在我的电脑上,我有 2 个独立的 GPU。我一直在使用 VFIO 将第二个 GPU 传递给 Windows VM 以处理某些程序。现在我想将功能更强大的第一个 GPU 传递给 Windows VM 以玩一些游戏。(如果需要,我可以创建第二个 Windows VM,这不是问题)。

我已经用脚本检查了第一个 GPU 是否有自己的 IOMMU 组,它确实有。

问题是,当我正常启动或通过第二个 GPU 时,Gnome DE 和 gdm3 启动没有问题,但当我通过第一个 GPU 时却没有。

显示器会根据传递的 GPU 打开/关闭。

我试过重启 gdm3、kill gnome-shell、重启,但似乎对 DE 没有任何影响。GDM3不知何故启动了,但它只是得到了密码并返回到用户选择菜单。

脚本的输出:(不包括不必要的东西,只有 2 个 GPU)

IOMMU Group 12:
    00:15.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD/ATI] SB700/SB800/SB900 PCI to PCI bridge (PCIE port 0) [1002:43a0]
    05:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Cedar [Radeon HD 5000/6000/7350/8350 Series] [1002:68f9]
    05:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Cedar HDMI Audio [Radeon HD 5400/6300/7300 Series] [1002:aa68]
IOMMU Group 14:
    01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Baffin [Radeon RX 460/560D / Pro 450/455/460/555/555X/560/560X] [1002:67ef] (rev cf)
    01:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Baffin HDMI/DP Audio [Radeon RX 550 640SP / RX 560/560X] [1002:aae0]

journalctl -u gdm当它开始时(无直通):

Feb 11 17:29:53 Alienus-PC systemd[1]: Starting GNOME Display Manager...
Feb 11 17:29:54 Alienus-PC systemd[1]: Started GNOME Display Manager.
Feb 11 17:29:57 Alienus-PC gdm-autologin][1490]: gkr-pam: no password is available for user
Feb 11 17:30:00 Alienus-PC gdm-autologin][1490]: pam_unix(gdm-autologin:session): session opened for user alienus by (uid=0)

journalctl -u gdm当它不启动时(第一个 GPU passthough):

Feb 11 17:25:58 Alienus-PC systemd[1]: Starting GNOME Display Manager...
Feb 11 17:25:58 Alienus-PC systemd[1]: Started GNOME Display Manager.
Feb 11 17:25:58 Alienus-PC gdm-autologin][2650]: gkr-pam: no password is available for user
Feb 11 17:25:58 Alienus-PC gdm-autologin][2650]: pam_unix(gdm-autologin:session): session opened for user alienus by (uid=0)
Feb 11 17:25:58 Alienus-PC gdm-autologin][2650]: gkr-pam: couldn't unlock the login keyring.
Feb 11 17:25:59 Alienus-PC gdm-autologin][2650]: pam_unix(gdm-autologin:session): session closed for user alienus
Feb 11 17:25:59 Alienus-PC gdm3[1359]: GdmDisplay: Session never registered, failing
Feb 11 17:25:59 Alienus-PC gdm-launch-environment][2659]: pam_unix(gdm-launch-environment:session): session opened for user gdm by (uid=0)
Feb 11 17:25:59 Alienus-PC gdm-launch-environment][2659]: pam_unix(gdm-launch-environment:session): session closed for user gdm
Feb 11 17:25:59 Alienus-PC gdm3[1359]: Child process -2688 was already dead.

journalctl -u gdm启用调试(/etc/gdm3/custom.conf,第一个 GPU 直通):https://paste.ubuntu.com/p/cSsDpBynyM/ (输出大约 52k 个字符,我不能在这里发布)

系统规格:

  • Ubuntu 20.04.5

  • 内核 5.15.0-60-通用

  • 技嘉GA-970-D3主板

  • 中央处理器AMD FX 6100

  • 第一个 GPU AMD RX 460 4G

  • 第二个 GPU AMD Radeon 5450

virtual-machine
  • 1 1 个回答
  • 22 Views

1 个回答

  • Voted
  1. Best Answer
    Emre Talha
    2023-02-13T05:53:35+08:002023-02-13T05:53:35+08:00

    这个答案解决了我无法使用第二个 GPU 启动 Gnome 的问题。

    为了进入没有活动 X 会话的状态,我在禁用第一个 GPU 的情况下启动。之后,我切换到tty3并运行Xorg -configure. 它创建了一个包含 21 个卡和屏幕的配置文件(很奇怪,也许它适用于所有 PCI ID)。

    在删除除我的第二个 GPU 之外的所有其他卡之后,除了前 3 个之外的所有屏幕,我将配置文件复制到/etc/X11/xorg.conf并重新启动。

    起初,我想看看当我没有禁用第一个 GPU 并正常启动时这是否有效。显示器的数量已经改变,当我向xrandr --listproviders供应商查询时,ID 为 0 的是我的第二个 GPU。在那之后,我重新启动并禁用了第一个 GPU,并且它毫无问题地启动了 Gnome DE。

    我的xorg.conf档案:

    Section "ServerLayout"
        Identifier     "X.org Configured"
        Screen      0  "Screen0" 0 0
        Screen      1  "Screen1" RightOf "Screen0"
        Screen      2  "Screen2" RightOf "Screen1"
        InputDevice    "Mouse0" "CorePointer"
        InputDevice    "Keyboard0" "CoreKeyboard"
    EndSection
    
    Section "Files"
        ModulePath   "/usr/lib/xorg/modules"
        FontPath     "/usr/share/fonts/X11/misc"
        FontPath     "/usr/share/fonts/X11/cyrillic"
        FontPath     "/usr/share/fonts/X11/100dpi/:unscaled"
        FontPath     "/usr/share/fonts/X11/75dpi/:unscaled"
        FontPath     "/usr/share/fonts/X11/Type1"
        FontPath     "/usr/share/fonts/X11/100dpi"
        FontPath     "/usr/share/fonts/X11/75dpi"
        FontPath     "built-ins"
    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 "Monitor"
        Identifier   "Monitor2"
        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     "SWcursor"              # [<bool>]
            #Option     "EnablePageFlip"        # [<bool>]
            #Option     "SubPixelOrder"         # [<str>]
            #Option     "ZaphodHeads"           # <str>
            #Option     "AccelMethod"           # <str>
            #Option     "DRI3"                  # [<bool>]
            #Option     "DRI"                   # <i>
            #Option     "ShadowPrimary"         # [<bool>]
            #Option     "TearFree"              # [<bool>]
            #Option     "DeleteUnusedDP12Displays"  # [<bool>]
            #Option     "VariableRefresh"       # [<bool>]
        Identifier  "Card0"
        Driver      "amdgpu"
        BusID       "PCI:5: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
    
    Section "Screen"
        Identifier "Screen2"
        Device     "Card2"
        Monitor    "Monitor2"
        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
    
    • 0

相关问题

  • VirtualBox guest Win10 @ Linux 主机在启动时挂了很大的时间,如何排除故障?

  • Debian 9:如何在 QEMU-Host 和 QEMU-Guest (Windows) 之间设置 Samba-Exchange?

  • 如何手动触发来宾上的 virtio 气球驱动程序?

  • 如何在运行时从命令行更改 KVM VNC 端口?

  • LXC 容器内部从零开始的 Linux

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve