在配备两个 AMD GPU 的笔记本电脑上更正 OpenGL 版本

在配备两个 AMD GPU 的笔记本电脑上更正 OpenGL 版本

我在一台配备两个 AMD GPU 的笔记本电脑上使用 Gentoo:一个集成显卡和一个独立显卡。lspci返回的内容如下:

00:01.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Richland [Radeon HD 8650G] [1002:990b]
    Subsystem: Micro-Star International Co., Ltd. [MSI] Richland [Radeon HD 8650G] [1462:10ef]
    Kernel driver in use: radeon
--
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Neptune XT [Radeon HD 8970M] [1002:6801] (rev ff)
    Kernel driver in use: radeon

现在正确设置开源驱动程序的方法是什么?根据Gentoo Wiki 上的功能支持表,我设定make.conf

VIDEO_CARDS="radeon r600 radeonsi"

因此两个驱动程序都支持两个 GPU。让我困扰的是输出glxinfo

$ DRI_PRIME=0 glxinfo | grep -i opengl # integrated gpu
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD ARUBA
OpenGL version string: 2.1 Mesa 10.3.7
OpenGL shading language version string: 1.30

$ DRI_PRIME=1 glxinfo | grep -i opengl # discrete gpu
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD PITCAIRN
OpenGL version string: 2.1 Mesa 10.3.7
OpenGL shading language version string: 1.30

再次,根据上面的功能表,两个 GPU 的驱动程序至少支持 OpenGL 3.3,但这里显然不是这种情况。我做错了什么吗?

答案1

实际上,经过一周左右的努力、尝试和潜伏,俄罗斯 Linux 社区的某个人帮助了我,所以我将在这里重新发布。原因是启用了bindistmesa 包的使用标志:

~ $ equery uses mesa
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for media-libs/mesa-11.0.0_rc2:
 U I
 + + abi_x86_32           : 32-bit (x86) libraries
 + + bindist              : Disable patent-encumbered ARB_texture_float, EXT_texture_shared_exponent, and EXT_packed_float extensions.
 + + classic              : Build drivers based on the classic architecture.
...

更好的是,我bindist全局启用了 use 标志。从 中删除它后make.conf,我还禁用了inclassic的使用标志并重新合并了 mesa:media-libs/mesapackage.use

~ $ DRI_PRIME=0 glxinfo | grep -i opengl
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD ARUBA (DRM 2.43.0, LLVM 3.7.0)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 11.0.0-rc2
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 11.0.0-rc2
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 11.0.0-rc2
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00

~ $ DRI_PRIME=1 glxinfo | grep -i opengl                                                                                                                         
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD PITCAIRN (DRM 2.43.0, LLVM 3.7.0)
OpenGL core profile version string: 4.1 (Core Profile) Mesa 11.0.0-rc2
OpenGL core profile shading language version string: 4.10
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 11.0.0-rc2
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 11.0.0-rc2
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00

相关内容