R. *_*ell 5 graphics intel-graphics opengl drivers 19.04
我似乎无法在带有英特尔集成显卡的 Ubuntu 19.04 上获得 OpenGL 4.5 支持。完全不熟悉使用 OpenGL,我正在尝试运行一些现有代码。
尝试在 Python 中运行 OpenGL 代码时,RuntimeError 是:
RuntimeError: 0:1(10): error: GLSL 4.50 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, 3.00 ES, 3.10 ES, and 3.20 ES
Run Code Online (Sandbox Code Playgroud)
这篇文章的其余部分将非常模糊,但我的基本问题是;我该如何解决这个问题?
如果我理解正确,您的 OpenGL 版本决定了支持哪些 GLSL 版本。您对 OpenGL 的支持由硬件决定,在这种情况下,您需要获取正确的驱动程序。
我的英特尔 CPU 提供 UHD Graphics 630,它(根据本页)应该支持带有适当驱动程序的 OpenGL 4.5。
在全新的 Ubuntu 19.04 安装上glxinfo | grep "OpenGL version"返回OpenGL version string: 3.0 Mesa 19.0.8. 我正在阅读“由 Mesa 19.0.8 提供的 OpenGL 3.0 版实现”。在寻找解决方案时,我在 askubuntu 上找到了这篇文章,它提供了使用 ppa 在 Ubuntu 上升级英特尔图形驱动程序的说明。详细信息在该帖子上,但要升级到新驱动程序,它是:
sudo add-apt-repository ppa:oibaf/graphics-drivers
sudo apt update && sudo apt upgrade
现在glxinfo | grep "OpenGL version"给了我OpenGL version string: 3.0 Mesa 19.3.0-devel (git-ffb0d3a 2019-09-29 disco-oibaf-ppa)它似乎有一个新的 Mesa 版本,但 OpenGL 仍然是 3.0 版。也就是说,glxinfo | "OpenGL"我得到的完整输出:
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) UHD Graphics 630 (Coffeelake 3x8 GT2)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 19.3.0-devel (git-ffb0d3a 2019-09-29 disco-oibaf-ppa)
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 19.3.0-devel (git-ffb0d3a 2019-09-29 disco-oibaf-ppa)
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 19.3.0-devel (git-ffb0d3a 2019-09-29 disco-oibaf-ppa)
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:
Run Code Online (Sandbox Code Playgroud)
其中显示了 4.6 的核心配置文件版本和核心配置文件着色语言版本?上面终端输出中的核心条目和非核心条目之间有什么区别?
我可以发布 GLSL 代码,但我认为它没有用,因为它不是代码问题(我知道此代码在具有正确 OpenGL 设置的机器上运行良好,设置是我正在努力解决的问题! )
如果问题有问题,请将其标记为问题,我会尝试解决这些问题。任何和所有的帮助表示赞赏。谢谢!
感谢上面SurvivalMachine的评论,发现了这个问题。我使用的 PyGame 版本 (1.9.5) 创建了错误类型的上下文(兼容性),不支持 GLSL 4.50。这是/曾经是 PyGame 的一个已知问题,并且根据他们的 github 从 PyGame 2.0.0 开始已修复。为了解决这个问题,我更新到了 PyGame 2.0.0.dev3,它允许您在创建上下文时强制使用正确的 OpenGL 版本。有关详细信息,请参阅此StackOverflow 帖子(链接到相关 github 问题)。
| 归档时间: |
|
| 查看次数: |
3118 次 |
| 最近记录: |