如何在Ubuntu上使用Mesa 10.1启用OpenGL 3.3 [英] How to enable OpenGL 3.3 using Mesa 10.1 on Ubuntu

查看:130
本文介绍了如何在Ubuntu上使用Mesa 10.1启用OpenGL 3.3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图获得一个基于OpenGL的渲染引擎,该引擎依赖OpenGL 3.3和GLSL 3.3在AMD Radeon 6950上的Ubuntu 13.10上运行.我想使用开源驱动程序(radeon),它依赖于Mesa的OpenGL实现. Ubuntu 13.10仅开箱即用"提供Mesa 9.2(实现OpenGL 3.1).但是,可以从此PPA "> 如该线程中所述:

I am trying to get an OpenGL-based rendering engine that relies on OpenGL 3.3 and GLSL 3.3 to run on Ubuntu 13.10 using an AMD Radeon 6950. I want to use the open source drivers (radeon), which rely on Mesa for their OpenGL implementation. Ubuntu 13.10 only provides Mesa 9.2 (implementing OpenGL 3.1) "out of the box". It is however possible to install Mesa 10.1 (implementing OpenGL 3.3) from this PPA as explained in this thread:

StackOverflow: OpenGL & Ubuntu 12.04下HD Graphics 4000上的GLSL 3.3

StackOverflow: OpenGL & GLSL 3.3 on an HD Graphics 4000 under Ubuntu 12.04

我使用了与那里说明完全相同的步骤:

I used the exact same steps as explained there:

1.) Add the PPA Repository
  $ sudo add-apt-repository ppa:oibaf/graphics-drivers
2.) Update sources
  $ sudo apt-get update
3.) Dist-upgrade (rebuilds many packages)
  $ sudo apt-get dist-upgrade
4.) Then I rebooted.

Mesa 10.1已成功安装.但是,glxinfo现在报告正在使用Mesa 10.1,但仍仅报告OpenGL 3.0(兼容配置文件)和OpenGL 3.1(核心配置文件):

Mesa 10.1 was successfully installed. However, glxinfo, while it now reports that Mesa 10.1 is in use, still reports only OpenGL 3.0 (compat profile) and OpenGL 3.1 (core profile):

$ glxinfo | grep OpenGL
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD CAYMAN
OpenGL core profile version string: 3.1 (Core Profile) Mesa 10.1.0-devel (git-7f57408 saucy-oibaf-ppa+curaga)
OpenGL core profile shading language version string: 1.40
OpenGL core profile context flags: (none)
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 10.1.0-devel (git-7f57408 saucy-oibaf-ppa+curaga)
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:

那是为什么?如何启用OpenGL 3.3?通过比较可以看到我提到的> StackOverflow线程,可能有glxinfo报告OpenGL 3.3.我知道glxinfo可能会根据 Mesa 10.1发行说明报告错误的版本号,但是我尝试运行的渲染引擎因此失败.

Why is that? How can I enable OpenGL 3.3? As can be seen by comparison in the StackOverflow thread that I mentioned, it is possible to have glxinfo report OpenGL 3.3. I am aware that glxinfo may report the wrong version numbers as per the Mesa 10.1 Release Notes, however the rendering engine I'm trying to run fails because of this.

我使用以下代码生成一个窗口:

I use the following code to spawn a window:

glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 3);
glfwOpenWindowHint(GLFW_OPENGL_PROFILE, 0);

if(GL_TRUE != glfwOpenWindow(
    _windowDimensions.x, _windowDimensions.y,
    0, 0, 0, 0, 32, 0, GLFW_WINDOW))
{
    THROW("GLFW error: failed to create window.");
}

当我尝试使用此设置运行渲染引擎时,会抛出上述异常,因为不支持OpenGL 3.3.我可以将GLFW_OPENGL_VERSION_MINOR设置为0,然后窗口可以正常打开,但是稍后将引发异常,因为需要GLSL 3.3着色器.

When I try to run the rendering engine using this setup, the above exception gets thrown as OpenGL 3.3 is not supported. I can set GLFW_OPENGL_VERSION_MINOR to 0 and then the window opens fine, but an exception will be thrown later as GLSL 3.3 shaders are required.

还请注意,当我使用专有的fglrx驱动程序(然后glxinfo报告OpenGL版本4.2)时,渲染引擎运行良好,因此应用程序本身并不是问题,但受支持的OpenGL是问题.

Also note that the rendering engine runs fine when I use the proprietary fglrx drivers (and then glxinfo reports OpenGL version 4.2), so the application itself really is not the problem, but the supported OpenGL is.

那我做错了什么? Mesa 10.1为什么不为我支持OpenGL 3.3?我的显卡当然支持它.

So what am I doing wrong? Why doesn't Mesa 10.1 support OpenGL 3.3 for me? My graphics card certainly supports it.

以下是一些有用的其他信息.

Here's some additional information that may be useful.

$ apt-cache policy libgl1-mesa-glx
libgl1-mesa-glx:
  Installed: 10.1~git1402041945.7f5740+curaga~gd~s
  Candidate: 10.1~git1402041945.7f5740+curaga~gd~s
  Version table:
 *** 10.1~git1402041945.7f5740+curaga~gd~s 0
        500 http://ppa.launchpad.net/oibaf/graphics-drivers/ubuntu/ saucy/main amd64 Packages
        100 /var/lib/dpkg/status
     9.2.1-1ubuntu3 0
        500 http://archive.ubuntu.com/ubuntu/ saucy/main amd64 Packages


$ lspci -vv
...snip...
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Cayman PRO [Radeon HD 6950] (prog-if 00 [VGA controller])
    Subsystem: Hightech Information System Ltd. Device 2307
    Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 0, Cache Line Size: 64 bytes
    Interrupt: pin A routed to IRQ 53
    Region 0: Memory at c0000000 (64-bit, prefetchable) [size=256M]
    Region 2: Memory at fe620000 (64-bit, non-prefetchable) [size=128K]
    Region 4: I/O ports at e000 [size=256]
    Expansion ROM at fe600000 [disabled] [size=128K]
    Capabilities: <access denied>
    Kernel driver in use: radeon
...snip...


$ lsmod | egrep 'radeon|fglrx'
radeon               1402995  3
i2c_algo_bit           13413  1 radeon
ttm                    84169  1 radeon
drm_kms_helper         52710  1 radeon
drm                   297056  5 ttm,drm_kms_helper,radeon


$ modinfo radeon
filename:       /lib/modules/3.11.0-15-generic/kernel/drivers/gpu/drm/radeon/radeon.ko
license:        GPL and additional rights
description:    ATI Radeon
author:         Gareth Hughes, Keith Whitwell, others.
...snip...
firmware:       radeon/CAYMAN_smc.bin
firmware:       radeon/CAYMAN_rlc.bin
firmware:       radeon/CAYMAN_mc.bin
firmware:       radeon/CAYMAN_me.bin
firmware:       radeon/CAYMAN_pfp.bin
...snip...
srcversion:     D174B1E4686391B33437915
alias:          pci:v00001002d000099A4sv*sd*bc*sc*i*
alias:          pci:v00001002d000099A2sv*sd*bc*sc*i*
...snip...
depends:        drm,drm_kms_helper,ttm,i2c-algo-bit
intree:         Y
vermagic:       3.11.0-15-generic SMP mod_unload modversions 
parm:           no_wb:Disable AGP writeback for scratch registers (int)
parm:           modeset:Disable/Enable modesetting (int)
parm:           dynclks:Disable/Enable dynamic clocks (int)
parm:           r4xx_atom:Enable ATOMBIOS modesetting for R4xx (int)
parm:           vramlimit:Restrict VRAM for testing (int)
parm:           agpmode:AGP Mode (-1 == PCI) (int)
parm:           gartsize:Size of PCIE/IGP gart to setup in megabytes (32, 64, etc) (int)
parm:           benchmark:Run benchmark (int)
parm:           test:Run tests (int)
parm:           connector_table:Force connector table (int)
parm:           tv:TV enable (0 = disable) (int)
parm:           audio:Audio enable (1 = enable) (int)
parm:           disp_priority:Display Priority (0 = auto, 1 = normal, 2 = high) (int)
parm:           hw_i2c:hw i2c engine enable (0 = disable) (int)
parm:           pcie_gen2:PCIE Gen2 mode (-1 = auto, 0 = disable, 1 = enable) (int)
parm:           msi:MSI support (1 = enable, 0 = disable, -1 = auto) (int)
parm:           lockup_timeout:GPU lockup timeout in ms (defaul 10000 = 10 seconds, 0 = disable) (int)
parm:           fastfb:Direct FB access for IGP chips (0 = disable, 1 = enable) (int)
parm:           dpm:DPM support (1 = enable, 0 = disable, -1 = auto) (int)
parm:           aspm:ASPM support (1 = enable, 0 = disable, -1 = auto) (int)


$ dpkg -S /lib/modules/3.11.0-15-generic/kernel/drivers/gpu/drm/radeon/radeon.ko
linux-image-extra-3.11.0-15-generic: /lib/modules/3.11.0-15-generic/kernel/drivers/gpu/drm/radeon/radeon.ko


$ apt-cache policy linux-image-extra-3.11.0-15-generic
linux-image-extra-3.11.0-15-generic:
  Installed: 3.11.0-15.25
  Candidate: 3.11.0-15.25
  Version table:
 *** 3.11.0-15.25 0
        500 http://archive.ubuntu.com/ubuntu/ saucy-updates/main amd64 Packages
        500 http://archive.ubuntu.com/ubuntu/ saucy-security/main amd64 Packages
        100 /var/lib/dpkg/status

推荐答案

他们没有告诉您的内容,但间接暗示(某些驱动程序不支持OpenGL 3.3所需的所有功能." ),就是在Mesa(10.0)的最新正式版本中,GL 3.3仅适用于Intel硬件.这是英特尔密切参与Mesa项目的乐趣之一.如果您希望在AMD硬件上以任何形式获得可靠的GL 3.3支持,则应暂时使用fglrx(AMD专有驱动程序).

What they do not tell you, but indirectly imply ("Some drivers don't support all the features required in OpenGL 3.3."), is that in the last official release of Mesa (10.0), GL 3.3 only works on Intel hardware. This is one of the joys of Intel's close involvement with the Mesa project. If you want reliable GL 3.3 support in any form on AMD hardware, you should use fglrx (the proprietary AMD driver) for the time being.

Mesa 10.1的开发版本可能在radeon驱动程序上实现GL 3.3,但是您需要请求3.3核心配置文件.您当前不在执行此操作.

The development release of Mesa 10.1 may implement GL 3.3 on radeon drivers, but you need to request a 3.3 core profile. You are not doing this currently.

glfwOpenWindowHint(GLFW_OPENGL_PROFILE, 0);

实际上需要这样:

glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);


此外,没有诸如GL 3.0兼容性配置文件或3.1核心配置文件之类的东西.直到3.2才将配置文件引入OpenGL. GL 3.1中有GL_ARB_compatibility的概念,但这与配置文件不同. glxinfo提供了令人误解的信息.


Also, there is no such thing as a GL 3.0 compatibility profile or 3.1 core profile. Profiles were not introduced into OpenGL until 3.2. There is a concept of GL_ARB_compatibility in GL 3.1, but that is not the same thing as a profile; glxinfo is giving misleading information.

这篇关于如何在Ubuntu上使用Mesa 10.1启用OpenGL 3.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆