我在为 Ubuntu Gnome 16.04 系统安装驱动程序时遇到问题AMD GPU PRO
。安装并重启后屏幕变黑。GUI 模式下的图像不完整,大部分是黑色,登录屏幕有小部分闪烁。鼠标光标可见。
我可以访问tty
并将其卸载。
我从AMD官方网站下载了驱动程序关联。他们说它与我的显卡兼容:AMD Radeon™ R9 285 显卡。我按照网站上提供的安装指南进行操作。安装顺利完成,重启后屏幕变黑。
跑步uname -r
可得:
4.4.0-28-generic
跑步dpkg -l amdgpu-pro
可得:
dpkg-query: no packages found matching amdgpu-pro
跑步./amdgpu-pro-install
可得:
Reading package lists... Done
Building dependency tree
...........................
Reading state information... Done
The following packages were automatically installed and are no longer required:
gcc-5-base:i386 libdrm-radeon1:i386 libdrm2:i386 libelf1:i386
libssl1.0.0:i386 libstdc++6:i386 libx11-6:i386 libx11-xcb1:i386 libxau6:i386
libxcb-dri2-0:i386 libxcb-dri3-0:i386 libxcb-glx0:i386 libxcb-present0:i386
libxcb-sync1:i386 libxcb1:i386 libxdamage1:i386 libxdmcp6:i386 libxext6:i386
libxfixes3:i386 libxshmfence1:i386 libxxf86vm1:i386 linux-headers-4.4.0-21
linux-headers-4.4.0-21-generic linux-image-4.4.0-21-generic
linux-image-extra-4.4.0-21-generic
Use 'sudo apt autoremove' to remove them.
......................
Reading package lists... Done
deb file:/var/opt/amdgpu-pro/ ./
Reading package lists... Done
W: The repository 'file:/var/opt/amdgpu-pro ./ Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-4.4.0-21 linux-headers-4.4.0-21-generic
linux-image-4.4.0-21-generic linux-image-extra-4.4.0-21-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
amdgpu-pro-clinfo amdgpu-pro-computing amdgpu-pro-core amdgpu-pro-firmware
amdgpu-pro-graphics amdgpu-pro-libopencl-dev amdgpu-pro-libopencl-dev:i386
amdgpu-pro-libopencl1 amdgpu-pro-libopencl1:i386 amdgpu-pro-opencl-icd
amdgpu-pro-opencl-icd:i386 amdgpu-pro-vulkan-driver
amdgpu-pro-vulkan-driver:i386 libdrm-amdgpu-pro-amdgpu1
libdrm-amdgpu-pro-amdgpu1:i386 libdrm2-amdgpu-pro libdrm2-amdgpu-pro:i386
libegl1-amdgpu-pro libegl1-amdgpu-pro:i386 libgbm1-amdgpu-pro:i386
libgbm1-amdgpu-pro libgl1-amdgpu-pro-dev libgl1-amdgpu-pro-dev:i386
libgl1-amdgpu-pro-dri libgl1-amdgpu-pro-dri:i386 libgl1-amdgpu-pro-glx:i386
libgl1-amdgpu-pro-glx libgles2-amdgpu-pro libgles2-amdgpu-pro:i386
libvdpau-amdgpu-pro libvdpau-amdgpu-pro:i386 xserver-xorg-video-amdgpu-pro
The following NEW packages will be installed
amdgpu-pro amdgpu-pro-clinfo amdgpu-pro-computing amdgpu-pro-core
amdgpu-pro-dkms amdgpu-pro-firmware amdgpu-pro-graphics
amdgpu-pro-lib32:i386 amdgpu-pro-libopencl-dev amdgpu-pro-libopencl-dev:i386
amdgpu-pro-libopencl1 amdgpu-pro-libopencl1:i386 amdgpu-pro-opencl-icd
amdgpu-pro-opencl-icd:i386 amdgpu-pro-vulkan-driver
amdgpu-pro-vulkan-driver:i386 libdrm-amdgpu-pro-amdgpu1
libdrm-amdgpu-pro-amdgpu1:i386 libdrm2-amdgpu-pro libdrm2-amdgpu-pro:i386
libegl1-amdgpu-pro libegl1-amdgpu-pro:i386 libgbm1-amdgpu-pro:i386
libgbm1-amdgpu-pro libgl1-amdgpu-pro-dev libgl1-amdgpu-pro-dev:i386
libgl1-amdgpu-pro-dri libgl1-amdgpu-pro-dri:i386 libgl1-amdgpu-pro-glx:i386
libgl1-amdgpu-pro-glx libgles2-amdgpu-pro libgles2-amdgpu-pro:i386
libvdpau-amdgpu-pro libvdpau-amdgpu-pro:i386 xserver-xorg-video-amdgpu-pro
0 to upgrade, 35 to newly install, 0 to remove and 0 not to upgrade.
Need to get 0 B/84.0 MB of archives.
After this operation, 400 MB of additional disk space will be used.
问题:如何进行,我应该在哪里寻找错误的依赖项或阻止驱动程序正常运行的某些东西,如何使其工作?
到目前为止我已经尝试过这个:
我已经使用 HDMI 和 DisplayPort 进行了测试,两者的结果相同。
已尝试
sudo dpkg --add-architecture i386
和sudo apt -get update
。
dmesg
输出:(我从dmesg
日志中包含了一些可能有助于识别问题的片段。)
amdgpu: module verification failed: signature and/or required key missing - tainting kernel
[drm] amdgpu kernel modesetting enabled.
AMD IOMMUv2 driver by Joerg Roedel <[email protected]>
AMD IOMMUv2 functionality not available on this system
fb: switching to amdgpudrmfb from VESA VGA
amdgpu 0000:01:00.0: Invalid ROM contents
ATOM BIOS: C76601
amdgpu 0000:01:00.0: VRAM: 2048M 0x0000000000000000 - 0x000000007FFFFFFF (2048M used)
amdgpu 0000:01:00.0: GTT: 2048M 0x0000000080000000 - 0x00000000FFFFFFFF
amdgpu 0000:01:00.0: amdgpu: using MSI.
[drm] amdgpu: irq initialized.
Can't find requested voltage id in vdd_dep_on_sclk table!
amdgpu: powerplay initialized
amdgpu 0000:01:00.0: fence driver on ring 0 use gpu addr 0x0000000080000008, cpu addr 0xffff880425497008
[drm] [FeatureOverride_overriden feature] Overridden FEATURE_ENABLE_GPU_SCALING is enabled now
fbcon: amdgpudrmfb (fb0) is primary device
amdgpu 0000:01:00.0: fb0: amdgpudrmfb frame buffer device
[drm] Initialized amdgpu 3.2.0 20150101 for 0000:01:00.0 on minor 0
答案1
引自http://www.phoronix.com/scan.php?page=article&item=amd-gpu-pro&num=1
起初,我尝试使用 Ubuntu 16.04 日常系统及其打包的 Xenial 内核。然而,尽管这个打包的 AMDGPU 二进制驱动程序使用 DKMS,但这个内核驱动程序的代码与 Linux 4.4 的兼容性存在问题。由于 DRM 内核接口的一些变化Linux 4.4,构建 DKMS 模块失败。正如 Bridgman 在论坛中指出的那样,AMD 应该会尽快修复此问题,但目前,简单的解决方法是在 Ubuntu 16.04 机器上安装 Linux 4.2
我没有尝试简单的解决方法,但我在当天早些时候找到了困难的方法,并且它对我来说没有任何问题。
然而如果您尝试此操作,我建议您在尝试之前备份您的系统。
Ubuntu GNOME 上的 AMDGPU-PRO 的问题是 COGL 无法正确编译。
有一个补丁文件:
由 Ashley Sommer 修复 AMDGPU-PRO 驱动程序的 COGL。 https://gist.github.com/ashleysommer/25118d366bf8c1608f3b1a64bc52d4e5
--- a/cogl/driver/gl/gl/cogl-driver-gl.c
+++ b/cogl/driver/gl/gl/cogl-driver-gl.c
@@ -403,9 +403,13 @@
&ctx->glsl_minor);
}
- if (COGL_CHECK_GL_VERSION (ctx->glsl_major, ctx->glsl_minor, 1, 2))
- /* We want to use version 120 if it is available so that the
- * gl_PointCoord can be used. */
+ if (COGL_CHECK_GL_VERSION (ctx->glsl_major, ctx->glsl_minor, 1, 5))
+ ctx->glsl_version_to_use = 150;
+ else if (COGL_CHECK_GL_VERSION (ctx->glsl_major, ctx->glsl_minor, 1, 4))
+ ctx->glsl_version_to_use = 140;
+ else if (COGL_CHECK_GL_VERSION (ctx->glsl_major, ctx->glsl_minor, 1, 3))
+ ctx->glsl_version_to_use = 130;
+ else if (COGL_CHECK_GL_VERSION (ctx->glsl_major, ctx->glsl_minor, 1, 2))
ctx->glsl_version_to_use = 120;
else
ctx->glsl_version_to_use = 110;
有用户指南伊尔维克兹有关如何在此处应用修复:
要做的事情:
您必须重建
libcogl20
软件包。由于我无法成功重建cogl
软件包,因此我只能替换libcogl.so
二进制文件本身。
sudo apt-get build-dep cogl
如果你得到:E: Unable to find a source package for cogl
sudo gedit /etc/apt/sources.list
并在文件末尾添加以下内容:
# COGL
deb-src ftp://ftp.de.debian.org/debian/ stable main contrib
下一个:
sudo apt-get update && sudo apt-get build-dep cogl
安装构建所需的几个包cogl
:
sudo apt-get install devscripts libcogl-gst-dev
然后继续:
The following commands I executed from the home directory,
because of permission errors and `command is not found`
errors I was getting.
apt-get source cogl
cd cogl-1.22.0
wget -O /tmp/cogl.patch https://gist.githubusercontent.com/ashleysommer/25118d366bf8c1608f3b1a64bc52d4e5/raw/e35e535e7ea9684538a63fe6ea0eb2709b1813f1/cogl_driver_gl_gl_cogl-driver-gl.c
patch -p1 < /tmp/cogl.patch
dpkg-source --commit
debuild -us -uc -j$(nproc)
如果构建成功结束,您只需使用或安装生成的
libcogl20
deb 文件(在父目录中):gdebi
dpkg
sudo dpkg -i libcogl20_1.22.0-2_amd64.deb
如果您也像我一样失败了,那么还有另一种选择,您可以按照我的做法去做。
由于我这边构建在某些不必要的部分失败了,但是修补的库构建得很好,所以我只是手动替换了二进制文件:
代码:
sudo cp -a debian/tmp/usr/lib/x86_64-linux-gnu/libcogl.so.20.4.1 /usr/lib/x86_64-linux-gnu/libcogl.so.20.4.1
桌面冻结了几秒钟。
因为我覆盖了来自包的文件,所以我将该包标记为“保留”,以确保将来的更新不会覆盖它,出于同样的原因,如果您成功构建了包,最好也保留它。
代码:
sudo apt-mark hold libcogl20
如果你想恢复脏东西,你只需要这样做:
代码:
sudo apt-mark unhold libcogl20
sudo apt-get install --reinstall libcogl20
专业提示,您可以使用 debsums 工具(来自 debsums 包)来检查您正在运行的是来自包的 libcogl.so 还是像我一样快速而肮脏的修补程序:
代码:
debsums -s libcogl20
debsums: changed file /usr/lib/x86_64-linux-gnu/libcogl.so.20.4.1 (from libcogl20:amd64 package)
如果您成功构建了该包并以 dpkg 方式安装它,debsums 将不会抱怨。
amdgpu-pro 安装的最后一部分如下所示
Setting up amdgpu-pro (16.30.3-315407) ...
Setting up amdgpu-pro-dkms (16.30.3-315407) ...
Loading new amdgpu-pro-16.30.3-315407 DKMS files...
First Installation: checking all kernels...
Building for 4.4.0-36-generic and 4.8.0-rc5
Building for architecture x86_64
Building initial module for 4.4.0-36-generic
Done.
amdgpu:
Running module version sanity check.
- Original module
- Installation
- Installing to /lib/modules/4.4.0-36-generic/updates/dkms/
depmod....
DKMS: install completed.
Building initial module for 4.8.0-rc5
ERROR: Cannot create report: [Errno 17] File exists:
'/var/crash/amdgpu-pro-dkms.0.crash'
Error! Bad return status for module build on kernel: 4.8.0-rc5 (x86_64)
Consult /var/lib/dkms/amdgpu-pro/16.30.3-315407/build/make.log for more information.
update-initramfs: deferring update (trigger activated)
Setting up amdgpu-pro-lib32:i386 (16.30.3-315407) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Processing triggers for initramfs-tools (0.122ubuntu8.1) ...
update-initramfs: Generating /boot/initrd.img-4.8.0-rc5
Warning: Not updating LILO; /etc/lilo.conf not found!
2016 年 10 月 9 日更新:使用 RX 480。
安装成功,带有 4.4.0-36-generic
内核,
但内核模块构建4.8.0-rc5
失败。
确保您拥有:sudo apt-mark hold libcogl20
此命令可防止用较新版本gnome package updater
替换已编译版本libgogl20
。
它还会阻止安装其他软件包,因为某些软件包依赖于较新版本等等cogl
。
我们只需要等待官方修复这个问题,在此之前,这是一个让amdgpu-pro
驱动程序正常运行的好方法Ubuntu Gnome 16.04
。