我想简单地展示一个使用 gstreamer-1.0 的测试源。当我使用(我猜)非加速输出时,gst-launch-1.0 videotestsrc ! xvimagesink
一切都正常,但当我尝试播放它时,gst-launch-1.0 videotestsrc ! autovideosink
我收到以下错误:
Setting pipeline to PAUSED ...
libva info: VA-API version 0.35.0
X Error of failed request: BadRequest (invalid request code or no such operation)
Major opcode of failed request: 153 (DRI2)
Minor opcode of failed request: 1 (DRI2Connect)
Serial number of failed request: 15
Current serial number in output stream: 15
我已安装NVIDIA-Linux-x86_64-367.44.run
如下Ubuntu 14.04.5
:
- 删除旧驱动程序:
sudo apt-get remove --purge nvidia*
- 通过运行脚本将旧驱动程序列入黑名单(它会要求你这样做,然后退出)
- 重启
- 停止服务:
service lightdm stop && service x11-common stop
- 安装驱动程序:
./NVIDIA-Linux-x86_64-367.44.run --no-x-check
- 已安装 VA 相关内容https://wiki.ubuntuusers.de/Video-Dekodierung_beschleunigen/:
sudo apt-get install libvdpau1 vdpauinfo vdpau-va-driver vainfo
- 重启
以下是一些有用的输出,但仍会产生错误:
$ lspci -nnk | grep -i VGA -A2
05:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK106 [GeForce GTX 660] [10de:11c0] (rev a1)
Subsystem: Gigabyte Technology Co., Ltd Device [1458:354e]
Kernel driver in use: nvidia
$ vainfo
libva info: VA-API version 0.35.0
X Error of failed request: BadRequest (invalid request code or no such operation)
Major opcode of failed request: 153 (DRI2)
Minor opcode of failed request: 1 (DRI2Connect)
Serial number of failed request: 11
Current serial number in output stream: 11
$ glxinfo
name of display: localhost:10.0
X Error of failed request: GLXBadContext
Major opcode of failed request: 154 (GLX)
Minor opcode of failed request: 6 (X_GLXIsDirect)
Serial number of failed request: 20
Current serial number in output stream: 20
$ uname -a
Linux alpia 4.4.0-38-generic #57~14.04.1-Ubuntu SMP Tue Sep 6 17:20:43 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ cat /var/log/Xorg.0.log | grep driver
[ 127.579] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
[ 127.579] X.Org XInput driver : 22.1
[ 127.786] (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so
[ 128.733] (II) NVIDIA(0): [DRI2] VDPAU driver: nvidia
[ 128.815] ABI class: X.Org XInput driver, version 22.1
[ 128.815] (II) Using input driver 'evdev' for 'Power Button'
[ 128.830] (II) Using input driver 'evdev' for 'Power Button'
[ 128.831] (II) No input driver specified, ignoring this device.
[ 128.831] (II) No input driver specified, ignoring this device.
[ 128.831] (II) No input driver specified, ignoring this device.
[ 128.831] (II) No input driver specified, ignoring this device.
[ 128.832] (II) No input driver specified, ignoring this device.
[ 128.832] (II) No input driver specified, ignoring this device.
[ 128.832] (II) No input driver specified, ignoring this device.
[ 128.832] (II) No input driver specified, ignoring this device.
[ 128.832] (II) No input driver specified, ignoring this device.
[ 128.832] (II) No input driver specified, ignoring this device.
[ 128.833] (II) No input driver specified, ignoring this device.
[ 128.833] (II) No input driver specified, ignoring this device.
[ 128.833] (II) Using input driver 'evdev' for 'DELL Dell USB Entry Keyboard'
[ 128.833] (II) Using input driver 'evdev' for 'USB Optical Mouse'
[ 128.834] (II) No input driver specified, ignoring this device.
有人能提供提示吗?我知道按照说明操作后这台电脑曾经能用,但现在好像出了点问题。
答案1
通过将所有内容恢复为原始 Ubuntu 来修复它,但视频加速仍然不起作用:
- 删除前任司机:
sudo ./NVIDIA-Linux-x86_64-xxx.xx.run --uninstall
- 卸载与 nvidia 相关(通过 搜索相关软件包
dpkg -l
):nvidia、cuda、primus、vdpau-va-driver、vainfo、libvdpau1、vdpauinfo - 删除 nouveau 驱动程序的所有黑名单内容:删除
/etc/modprobe.d
- 通过以下方式恢复 xconfig:
sudo X -configure && sudo cp xorg.conf.new /etc/X11/xorg.conf
- 重新安装
mesa-vdpau-drivers-lts-<your release>
- 重要的:删除 gstreamer vaapi,以便它在使用类似
autoconvert
或autovideosink
的插件时不会尝试使用加速:sudo apt-get remove gstreamer1.0-vaapi gstreamer1.0-vaapi-doc libgstreamer-vaapi1.0-0:amd64 libgstreamer-vaapi1.0-dev
现在,测试程序glxinfo
再次glxgears
按预期运行。
无论如何:失败的尝试:我仍然不知道为什么即使使用官方 ppa,VA 东西也无法与原始驱动程序一起工作:
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install --install-suggests nvidia-340
glxinfo
并glxgears
正常工作,但vainfo
仍然vdpauinfo
输出错误。我设法vdpauinfo
通过使用驱动程序和导出来输出错误以外的内容mesa
(如果变量指向专有驱动程序,它将不起作用):
export VDPAU_DRIVER_PATH=/usr/lib/x86_64-linux-gnu/vdpau/
export VDPAU_DRIVER=va_gl
但这只是显示驱动程序,对吧。所以我需要告诉 VA API,它必须vdpau
像这样使用(?):
export LIBVA_DRIVERS_PATH=/usr/lib/x86_64-linux-gnu/dri/
export LIBVA_DRIVER_NAME=vdpau
但在那种情况下,vainfo
无论我选择哪个驱动程序名称,都只会回复错误。
如果有人知道如何使其工作,请帮忙。 但目前,gstreamer 可以再次运行(但 CPU 负载较高)。
以下是一些链接:
VDPAU Library Layout: http://http.download.nvidia.com/XFree86/vdpau/doxygen/html/group__api__winsys__x11.html
NVIDIA driver archive: http://www.nvidia.com/object/unix.html
Hardware video acceleration (Arch): https://wiki.archlinux.org/index.php/Hardware_video_acceleration
NVIDIA xorg config: http://us.download.nvidia.com/XFree86/Linux-x86/331.20/README/editxconfig.html