我的笔记本电脑有两张显卡(操作系统: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,那么你就成功了。干杯