![在 Ubuntu 20.04 中使用模式设置时没有虚拟显示(xrandr:配置 crtc 3 失败)](https://linux22.com/image/940198/%E5%9C%A8%20Ubuntu%2020.04%20%E4%B8%AD%E4%BD%BF%E7%94%A8%E6%A8%A1%E5%BC%8F%E8%AE%BE%E7%BD%AE%E6%97%B6%E6%B2%A1%E6%9C%89%E8%99%9A%E6%8B%9F%E6%98%BE%E7%A4%BA%EF%BC%88xrandr%EF%BC%9A%E9%85%8D%E7%BD%AE%20crtc%203%20%E5%A4%B1%E8%B4%A5%EF%BC%89.png)
我的笔记本电脑有两张显卡(操作系统:Ubuntu 20.04)。
$ lspci | grep VGA
>> 00:02.0 VGA compatible controller: Intel Corporation UHD Graphics (rev 05)
>> 01:00.0 VGA compatible controller: NVIDIA Corporation Device 1f95 (rev a1)
NVIDIA on-demand
我已在模式中启用了 Nvidia prime 。
该/etc/X11/xorg.conf
文件如下所示
section "Device"
Identifier "intel"
Driver "modesetting"
BusID "PCI:0:2:0"
EndSection
并且我添加了20-intel.conf
以下/usr/share/X11/xorg.conf.d/
内容。
Section "Device"
Identifier "intelgpu0"
Driver "intel"
Option "VirtualHeads" "2"
Option "TearFree" "true"
EndSection
重启后我运行了以下命令
xrandr --addmode VIRTUAL1 1920x1080
xrandr --output VIRTUAL1 --mode 1920x1080 --left-of eDP1
之后我能够创建虚拟显示。但图形模糊&vlc 中的视频无法播放或开始滞后。
将驱动程序更改modesetting
为20-intel.conf
Section "Device"
Identifier "intelgpu0"
Driver "modesetting"
Option "VirtualHeads" "2"
Option "TearFree" "true"
EndSection
模糊图形问题已解决。但我无法使用上述xrandr
命令创建虚拟显示器,我收到以下错误
xrandr: Configure crtc 3 failed.
答案1
目前我也正在尝试获取 VIRTUAL1 Runnung,并且我想我找到了您的答案: https://github.com/kbumsik/VirtScreen/issues/16
创建:sudo vim /usr/share/X11/xorg.conf.d/30-virtscreen.conf
内容为:
`# nvidia/nouveau/amdgpu device should be configured first before Intel GPU
Section "Device"
Identifier "nvidiagpu0"
Driver "nvidia" # Because you are using Nvidia proprietary driver. Change to "nouveau" if you are using open source nouveau driver
EndSection
# Then configure intel internal GPU
Section "Device"
Identifier "intelgpu0"
Driver "intel"
# You may put Option "VirtualHeads" "1" here but it seem you don't need to put this for Ubuntu 18.04.
EndSection`
如果你删除了 20-intel.conf,那么你就成功了。干杯