How to enable OpenGL 3.3 using Mesa 10.1 on Ubuntu - opengl

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 & 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 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:
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.");
}
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.
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.
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

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.
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.
This:
glfwOpenWindowHint(GLFW_OPENGL_PROFILE, 0);
Actually needs to be this:
glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
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.

I answered the thread OP mentions regarding "OpenGL & GLSL 3.3 on an HD Graphics 4000 under Ubuntu 12.04" but I thought I would give the same answer here too considering info seems so scarce. This works for those using freeglut and glew:
so Ive seen a lot of threads surrounding this and I thought here would be a good place to respond. Im running Ubuntu 15.04 with intel ivybridge. After using the "Intel Graphics installer for linux" application, glxinfo gives the following info regarding openGl:
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.6.0
OpenGL core profile shading language version string: 3.30
OpenGL version string: 3.0 Mesa 10.6.0
OpenGL shading language version string: 1.30
Now from this you can see that the core profile and glsl version are 3.3,but compatible openGl is only 3.0 thus if you want your code to run with 3.3 you need to specify both an opengl core profile and a glsl core profile. The following steps should work if youre using freeglut and glew:
-the glsl #version should specify that you want the core profile:
#version 330 core
-specify you want opengl 3.3:
glutInitContextVersion (3, 3);
-and finally set glewExperimental to true before glewInit():
glewExperimental = GL_TRUE;
hope this helps some people get started :)

Related

OpenGL version 2.1 is not supported by graphics driver and maybe need to update

I am using mayavi to do some visualization task on my remote server with GPUs.When my code run mlab.show(),the following error occurred
qt.glx: qglx_findConfig: Failed to finding matching FBConfig (8 8 8 0)
...
qt.glx: qglx_findConfig: Failed to finding matching FBConfig (1 1 1 0)
ERROR: In /work/standalone-x64-build/VTK-source/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 797
vtkXOpenGLRenderWindow (0x559c336fd4e0): GL version 2.1 with the gpu_shader4 extension is not supported by your graphics driver but is required for the new OpenGL rendering backend. Please update your OpenGL driver. If you are using Mesa please make sure you have version 10.6.5 or later and make sure your driver in Mesa supports OpenGL 3.2.
I am using Ubuntu16.04 and here is some info about my remote server.
(base) zz#SYS-4028GR-TR:~$ glxinfo | grep OpenGL
OpenGL vendor string: Mesa project: www.mesa3d.org
OpenGL renderer string: Mesa GLX Indirect
OpenGL version string: 1.3 Mesa 4.0.4
OpenGL extensions:
(base) zz#SYS-4028GR-TR:~$ glxinfo | grep render
direct rendering: No (If you want to find out why, try setting LIBGL_DEBUG=verbose)
GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer,
OpenGL renderer string: Mesa GLX Indirect
Does anyone have some ideas about this situation?I try to found some ways to update Mesa in Ubuntu but failed.If there is any way to deal with this kind of problem, it would be very helpful.
I am using mayavi to do some visualization task on my remote server with GPUs.
"Remote Server", that's your problem right there. If you log in via SSH forwarding the X11 connection, all OpenGL commands are serialized as GLX commands and tunneled through the X11 connection over the network to your computer to be executed on your local graphics system.
If you have a GPU on the remote system, your best option these days is to use Xpra, configuring so that it launches its backing X server on the GPU and not with a virtual framebuffer device.
What this comes down to is to install the regular Xorg server. Modify /etc/X11/Xwrapper to allow start by a regular user. You can then start the X server with Xpra being the first client with the command line
startx /usr/bin/Xpra start :100 --use-display --daemon=no -- :100
If you don't want to fix your display, then create a executable file /usr/local/bin/xpra_display
#!/bin/sh
exec xpra start $DISPLAY --use-display --daemon=no
which you can then launch with
startx /usr/local/bin/xpra_display
without further arguments

How do I utilize a different OpenGL profile?

I would like to replicate tutorials (sprite rendering), that use OpenGL version >= 3.3.
Geometry shaders for example were introduced in 3.2, and I get this error:
error: ‘GL_GEOMETRY_SHADER’ was not declared in this scope
I updated my mesa driver to the latest; I don't really understand though, how I can choose a newer version of OpenGL when compiling/linking in c++:
➜ glxinfo | grep -i "version"
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
Version: 17.1.4
Max core profile version: 4.5
Max compat profile version: 3.0
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.1
OpenGL core profile version string: 4.5 (Core Profile) Mesa 17.1.4
OpenGL core profile shading language version string: 4.50
OpenGL version string: 3.0 Mesa 17.1.4
OpenGL shading language version string: 1.30
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 17.1.4
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
I cannot really interpret this, but it says there is some kind of core profile using version 4.5. How do I utilize this profile?
I initialize the GL context in my code like this:
if(!glfwInit()) e_glfw_init();
m_window = glfwCreateWindow(WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_TITLE.c_str(), nullptr, nullptr);
if(m_window == nullptr) e_window_context();
glfwMakeContextCurrent(m_window);
glewExperimental = true;
if(glewInit() != GLEW_OK) e_glew_init();
According to the glfw documentation, you can specify the OpenGL version and profile by using the glfwWindowHint function:
if(!glfwInit()) e_glfw_init();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 5);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
m_window = glfwCreateWindow(WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_TITLE.c_str(),
nullptr, nullptr);
I had solved this issue on Linux by including these three headers when while playing with GLFW and shaders:
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glext.h>

GLFW cannot create a window: "GLX: Failed to create context: GLXBadFBConfig"

I'm trying to create a glfw window in my Debian Stretch system.
The code for initialize glfw:
// Initialize GLFW
void initGLFW()
{
if (!glfwInit())
{
exit(EXIT_FAILURE);
}
glfwSetErrorCallback(errorCallback);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_FALSE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE);
window = glfwCreateWindow(WINDOW_WIDTH, WINDOW_HEIGHT, "GLSL4.3 + GLM + VBO + VAO", NULL, NULL);
if (!window)
{
fprintf(stderr, "Failed to open GLFW window.\n");
glfwTerminate();
//system("pause");
exit(EXIT_FAILURE);
}
}
When I run the executable I get the messages above. Why?
GLX: Failed to create context: GLXBadFBConfig
Failed to open GLFW window.
Running with LIBGL_DEBUG=verbose I get this
libGL: Can't open configuration file /home/rafael/.drirc: No such file or directory.
libGL: pci id for fd 5: 8086:0a16, driver i965
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/tls/i965_dri.so
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
libGL: Can't open configuration file /home/rafael/.drirc: No such file or directory.
libGL: Using DRI3 for screen 0
Some useful infos:
$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 0b)
$ glxinfo | grep version
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
Max core profile version: 3.3
Max compat profile version: 3.0
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.0
OpenGL core profile version string: 3.3 (Core Profile) Mesa 11.2.2
OpenGL core profile shading language version string: 3.30
OpenGL version string: 3.0 Mesa 11.2.2
OpenGL shading language version string: 1.30
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 11.2.2
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
The initGLFW function is the first function called from main.
You are trying to create an OpenGL 4.0 Core profile context:
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
Your driver/OpenGL implementation only supports up to 3.3:
OpenGL core profile version string: 3.3 (Core Profile) Mesa 11.2.2
Max core profile version: 3.3
Mesa 11.2.2 could support OpenGL 4.1 but only on certain drivers (from the release notes of 11.0.0):
OpenGL 4.1 on radeonsi, nvc0
Mesa 12.0.0 seems to support OpenGL 4.3 on i965:
OpenGL 4.3 on nvc0, radeonsi, i965 (Gen8+)
The fix would be to update your graphics card, Mesa3D or to create a 3.3 context instead:
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);

OpenCL / OpenGL and osx crashes

I've been working on an opencl octree ray caster which is written in openframeworks. It takes point clouds of 5-10m points, builds an octree, passes the octree to the kernel and then runs about 200k raycasts to find point interceptions.
The code is working well enough, with results being rendered through vbo objects. See here and here for a couple of clips (still perfecting the intersection checks).
The problem is, I have been having a whole series of mac black screen moments lately. (I'm on a late 2013 mac pro with a recent el-cap update) I'm pretty sure that the black screens are some form of kernel crash or overload (?). They happen both occasionally when the app is running and also even when OF has been shut down and I've moved on to other work afterwards. Regularly enough to make working a nightmare...
I'm fairly green with opencl and the like but I think that my basic kernel code is sound. I am also including cleanup functions in the c++ on exit. Are there any other simple issues/safeguards that I may be unaware of that I need to be sure to include/I could try in my app?
It may be I need to include more information, happy to update in response to questions.
In hope
S
update:
here's a system report from the latest shut down; happened after a restart after a crash after running the app. I have totally zero clue:
Anonymous UUID: 1B68061F-68FC-BED2-559B-C8457A01380E
Sun Apr 24 16:03:12 2016
*** Panic Report ***
panic(cpu 6 caller 0xffffff7f92b72bd5): "GPU Panic: [<None>] 3 0 a0 d9 9 8 0 3 : NVRM[0/1:0:0]: Read Error 0x00000100: CFG 0xffffffff 0xffffffff 0xffffffff, BAR0 0x103e00000 0xffffff92013c9000 0x0e7150a2, D0, P3/4\n"#/Library/Caches/com.apple.xbs/Sources/AppleGraphicsControl/AppleGraphicsControl-3.12.6/src/AppleMuxControl/kext/GPUPanic.cpp:127
Backtrace (CPU 6), Frame : Return Address
0xffffff91fd61ae30 : 0xffffff800fadab12
0xffffff91fd61aeb0 : 0xffffff7f92b72bd5
0xffffff91fd61af90 : 0xffffff7f908241e0
0xffffff91fd61b050 : 0xffffff7f908f1ef4
0xffffff91fd61b090 : 0xffffff7f908f1f5f
0xffffff91fd61b110 : 0xffffff7f90b297a8
0xffffff91fd61b1b0 : 0xffffff7f90b413d2
0xffffff91fd61b1f0 : 0xffffff7f9096943a
0xffffff91fd61b220 : 0xffffff7f909693c5
0xffffff91fd61b250 : 0xffffff7f90a770c9
0xffffff91fd61b280 : 0xffffff7f90a78ea4
0xffffff91fd61b310 : 0xffffff7f90a79306
0xffffff91fd61b370 : 0xffffff7f90839636
0xffffff91fd61b3c0 : 0xffffff7f90a7d828
0xffffff91fd61b530 : 0xffffff7f90a7dc3a
0xffffff91fd61b5c0 : 0xffffff7f90928186
0xffffff91fd61b720 : 0xffffff7f90926ddf
0xffffff91fd61b760 : 0xffffff7f90936ffa
0xffffff91fd61b7c0 : 0xffffff7f90931337
0xffffff91fd61b7e0 : 0xffffff7f908eed6e
0xffffff91fd61b820 : 0xffffff7f908ede6f
0xffffff91fd61b890 : 0xffffff7f90827441
0xffffff91fd61b8b0 : 0xffffff7f90827ddb
0xffffff91fd61baa0 : 0xffffff7f9082815a
0xffffff91fd61bb40 : 0xffffff7f907d45c0
0xffffff91fd61bbc0 : 0xffffff7f907d3df2
0xffffff91fd61bc20 : 0xffffff7f907d574e
0xffffff91fd61bc60 : 0xffffff7f907864f5
0xffffff91fd61bcf0 : 0xffffff7f9077e10b
0xffffff91fd61bd20 : 0xffffff80100946b1
0xffffff91fd61bd70 : 0xffffff80100de2f9
0xffffff91fd61bde0 : 0xffffff800fb977a1
0xffffff91fd61be30 : 0xffffff800fadf283
0xffffff91fd61be60 : 0xffffff800fac28b8
0xffffff91fd61bea0 : 0xffffff800fad2665
0xffffff91fd61bf10 : 0xffffff800fbb8bda
0xffffff91fd61bfb0 : 0xffffff800fbeca96
Kernel Extensions in backtrace:
com.apple.iokit.IOGraphicsFamily(2.4.1)[172C2960-EDF5-382D-80A5-C13E97D74880]#0xffffff7f90774000->0xffffff7f907aefff
dependency: com.apple.iokit.IOPCIFamily(2.9)[4FE41F9B-2849-322A-BBF8-A94816C003D6]#0xffffff7f9032c000
com.apple.driver.AppleMuxControl(3.12.6)[44D361A1-4938-3AA5-9F73-9C909B66214B]#0xffffff7f92b64000->0xffffff7f92b77fff
dependency: com.apple.driver.AppleGraphicsControl(3.12.6)[1654475C-9A4B-386C-AFA8-0A530194A2F9]#0xffffff7f92b5c000
dependency: com.apple.iokit.IOACPIFamily(1.4)[5D7574C3-8E90-3873-BAEB-D979FC215A7D]#0xffffff7f90f7f000
dependency: com.apple.iokit.IOPCIFamily(2.9)[4FE41F9B-2849-322A-BBF8-A94816C003D6]#0xffffff7f9032c000
dependency: com.apple.iokit.IOGraphicsFamily(2.4.1)[172C2960-EDF5-382D-80A5-C13E97D74880]#0xffffff7f90774000
dependency: com.apple.driver.AppleBacklightExpert(1.1.0)[C49819CE-729A-36B2-9AC1-744A43DC236F]#0xffffff7f92b5f000
com.apple.nvidia.driver.NVDAResman(10.1)[8649777A-3EED-3F2F-8B12-FBC5517F62E6]#0xffffff7f907d2000->0xffffff7f90a4bfff
dependency: com.apple.iokit.IOPCIFamily(2.9)[4FE41F9B-2849-322A-BBF8-A94816C003D6]#0xffffff7f9032c000
dependency: com.apple.iokit.IONDRVSupport(2.4.1)[1114B99F-E439-329E-876D-1FEC4CF45DF6]#0xffffff7f907bb000
dependency: com.apple.iokit.IOGraphicsFamily(2.4.1)[172C2960-EDF5-382D-80A5-C13E97D74880]#0xffffff7f90774000
dependency: com.apple.AppleGraphicsDeviceControl(3.12.6)[F211EB28-182A-34BB-A610-87667618F925]#0xffffff7f907cb000
com.apple.nvidia.driver.NVDAGK100Hal(10.1)[EB8A5980-AB59-368A-8244-60A00C7A933C]#0xffffff7f90a57000->0xffffff7f90c05fff
dependency: com.apple.nvidia.driver.NVDAResman(10.1.0)[8649777A-3EED-3F2F-8B12-FBC5517F62E6]#0xffffff7f907d2000
dependency: com.apple.iokit.IOPCIFamily(2.9)[4FE41F9B-2849-322A-BBF8-A94816C003D6]#0xffffff7f9032c000
BSD process name corresponding to current thread: WindowServer
Mac OS version:
15E65
Kernel version:
Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64
Kernel UUID: 4E7B4496-0B81-34E9-97AF-F316103B0839
Kernel slide: 0x000000000f800000
Kernel text base: 0xffffff800fa00000
__HIB text base: 0xffffff800f900000
System model name: MacBookPro10,1 (Mac-C3EC7CD22292981F)
System uptime in nanoseconds: 8583589115
last loaded kext at 7720294530: com.apple.driver.AGPM 110.21.18 (addr 0xffffff7f92b3c000, size 122880)
loaded kexts:
net.telestream.driver.TelestreamAudio 1.0.5
com.logmein.driver.LogMeInSoundDriver 4.1.63f33
com.apple.driver.AGPM 110.21.18
com.apple.driver.ApplePlatformEnabler 2.6.0d0
com.apple.driver.X86PlatformShim 1.0.0
com.apple.driver.AppleMikeyHIDDriver 124
com.apple.driver.AppleOSXWatchdog 1
com.apple.driver.AppleMikeyDriver 274.7
com.apple.driver.AudioAUUC 1.70
com.apple.driver.AppleHDAHardwareConfigDriver 274.7
com.apple.driver.pmtelemetry 1
com.apple.iokit.IOUserEthernet 1.0.1
com.apple.driver.AppleHDA 274.7
com.apple.iokit.IOBluetoothSerialManager 4.4.4f4
com.apple.driver.AppleUpstreamUserClient 3.6.1
com.apple.Dont_Steal_Mac_OS_X 7.0.0
com.apple.GeForce 10.1.0
com.apple.driver.AppleIntelHD4000Graphics 10.1.4
com.apple.driver.AppleSMCLMU 208
com.apple.driver.ACPI_SMC_PlatformPlugin 1.0.0
com.apple.driver.AppleHV 1
com.apple.driver.AppleFIVRDriver 4.1.0
com.apple.driver.AppleBacklight 170.8.9
com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport 4.4.4f4
com.apple.driver.AppleSMCPDRC 1.0.0
com.apple.driver.AppleLPC 3.1
com.apple.driver.AppleThunderboltIP 3.0.8
com.apple.driver.AppleMuxControl 3.12.6
com.apple.driver.AppleIntelSlowAdaptiveClocking 4.0.0
com.apple.driver.AppleMCCSControl 1.2.13
com.apple.driver.AppleIntelFramebufferCapri 10.1.4
com.apple.nvidia.NVDAStartup 10.1.0
com.apple.driver.AppleUSBTCButtons 245.4
com.apple.iokit.IOBluetoothUSBDFU 4.4.4f4
com.apple.driver.AppleUSBTCKeyEventDriver 245.4
com.apple.driver.AppleUSBTCKeyboard 245.4
com.apple.driver.CoreStorageFsck 517.20.1
com.apple.driver.AppleFileSystemDriver 3.0.1
com.apple.AppleFSCompression.AppleFSCompressionTypeDataless 1.0.0d1
com.apple.AppleFSCompression.AppleFSCompressionTypeZlib 1.0.0
com.apple.BootCache 38
com.apple.driver.AirPort.Brcm4331 800.20.24
com.apple.driver.AppleSDXC 1.7.0
com.apple.iokit.AppleBCM5701Ethernet 10.2.0
com.apple.iokit.IOAHCIBlockStorage 2.8.5
com.apple.driver.AirPort.Brcm4360 1040.1.1a6
com.apple.driver.usb.AppleUSBEHCIPCI 1.0.1
com.apple.driver.AppleAHCIPort 3.1.8
com.apple.driver.AppleSmartBatteryManager 161.0.0
com.apple.driver.AppleACPIButtons 4.0
com.apple.driver.AppleRTC 2.0
com.apple.driver.AppleHPET 1.8
com.apple.driver.AppleSMBIOS 2.1
com.apple.driver.AppleACPIEC 4.0
com.apple.driver.AppleAPIC 1.7
com.apple.driver.AppleIntelCPUPowerManagementClient 218.0.0
com.apple.nke.applicationfirewall 163
com.apple.security.quarantine 3
com.apple.security.TMSafetyNet 8
com.apple.driver.AppleIntelCPUPowerManagement 218.0.0
com.apple.driver.DspFuncLib 274.7
com.apple.kext.OSvKernDSPLib 525
com.apple.iokit.IOSerialFamily 11
com.apple.driver.CoreCaptureResponder 1
com.apple.nvidia.driver.NVDAGK100Hal 10.1.0
com.apple.nvidia.driver.NVDAResman 10.1.0
com.apple.iokit.IOSurface 108.2.1
com.apple.driver.IOPlatformPluginLegacy 1.0.0
com.apple.iokit.IOBluetoothHostControllerUSBTransport 4.4.4f4
com.apple.iokit.IOBluetoothFamily 4.4.4f4
com.apple.driver.AppleHDAController 274.7
com.apple.iokit.IOHDAFamily 274.7
com.apple.iokit.IOAudioFamily 204.3
com.apple.vecLib.kext 1.2.0
com.apple.driver.AppleSMBusPCI 1.0.14d1
com.apple.driver.AppleThunderboltEDMSink 4.1.1
com.apple.driver.AppleThunderboltDPOutAdapter 4.1.3
com.apple.driver.AppleBacklightExpert 1.1.0
com.apple.driver.AppleGraphicsControl 3.12.6
com.apple.driver.X86PlatformPlugin 1.0.0
com.apple.driver.IOPlatformPluginFamily 6.0.0d7
com.apple.iokit.IOSlowAdaptiveClockingFamily 1.0.0
com.apple.iokit.IONDRVSupport 2.4.1
com.apple.driver.AppleSMC 3.1.9
com.apple.driver.AppleSMBusController 1.0.14d1
com.apple.iokit.IOAcceleratorFamily2 205.3
com.apple.AppleGraphicsDeviceControl 3.12.6
com.apple.iokit.IOGraphicsFamily 2.4.1
com.apple.iokit.IOSCSIArchitectureModelFamily 3.7.7
com.apple.driver.usb.IOUSBHostHIDDevice 1.0.1
com.apple.driver.AppleUSBMultitouch 250.5
com.apple.iokit.IOUSBHIDDriver 900.4.1
com.apple.driver.usb.cdc 5.0.0
com.apple.driver.usb.networking 5.0.0
com.apple.driver.usb.AppleUSBHostCompositeDevice 1.0.1
com.apple.driver.usb.AppleUSBHub 1.0.1
com.apple.driver.CoreStorage 517.20.1
com.apple.driver.AppleThunderboltDPInAdapter 4.1.3
com.apple.driver.AppleThunderboltDPAdapterFamily 4.1.3
com.apple.driver.AppleThunderboltPCIDownAdapter 2.0.2
com.apple.driver.AppleXsanScheme 3
com.apple.driver.AppleThunderboltNHI 4.0.4
com.apple.iokit.IOThunderboltFamily 6.0.2
com.apple.iokit.IOEthernetAVBController 1.0.3b3
com.apple.iokit.IO80211Family 1110.26
com.apple.driver.mDNSOffloadUserClient 1.0.1b8
com.apple.iokit.IONetworkingFamily 3.2
com.apple.driver.corecapture 1.0.4
com.apple.driver.AppleUSBMergeNub 900.4.1
com.apple.driver.usb.AppleUSBEHCI 1.0.1
com.apple.iokit.IOAHCIFamily 2.8.1
com.apple.driver.usb.AppleUSBXHCIPCI 1.0.1
com.apple.driver.usb.AppleUSBXHCI 1.0.1
com.apple.iokit.IOUSBFamily 900.4.1
com.apple.iokit.IOUSBHostFamily 1.0.1
com.apple.driver.AppleUSBHostMergeProperties 1.0.1
com.apple.driver.AppleEFINVRAM 2.0
com.apple.driver.AppleEFIRuntime 2.0
com.apple.iokit.IOHIDFamily 2.0.0
com.apple.iokit.IOSMBusFamily 1.1
com.apple.security.sandbox 300.0
com.apple.kext.AppleMatch 1.0.0d1
com.apple.driver.AppleKeyStore 2
com.apple.driver.AppleMobileFileIntegrity 1.0.5
com.apple.driver.AppleCredentialManager 1.0
com.apple.driver.DiskImages 417.2
com.apple.iokit.IOStorageFamily 2.1
com.apple.iokit.IOReportFamily 31
com.apple.driver.AppleFDEKeyStore 28.30
com.apple.driver.AppleACPIPlatform 4.0
com.apple.iokit.IOPCIFamily 2.9
com.apple.iokit.IOACPIFamily 1.4
com.apple.kec.pthread 1
com.apple.kec.corecrypto 1.0
com.apple.kec.Libm 1
Model: MacBookPro10,1, BootROM MBP101.00EE.B0A, 4 processors, Intel Core i7, 2.7 GHz, 16 GB, SMC 2.3f36
Graphics: Intel HD Graphics 4000, Intel HD Graphics 4000, Built-In
Graphics: NVIDIA GeForce GT 650M, NVIDIA GeForce GT 650M, PCIe, 1024 MB
Memory Module: BANK 0/DIMM0, 8 GB, DDR3, 1600 MHz, 0x80AD, 0x484D5434314753364D465238432D50422020
Memory Module: BANK 1/DIMM0, 8 GB, DDR3, 1600 MHz, 0x80AD, 0x484D5434314753364D465238432D50422020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0xEF), Broadcom BCM43xx 1.0 (7.21.95.175.1a6)
Bluetooth: Version 4.4.4f4 17685, 3 services, 27 devices, 1 incoming serial ports
Network Service: AirPort, AirPort, en0
Serial ATA Device: APPLE SSD SD512E, 500.28 GB
USB Device: USB 2.0 Bus
USB Device: Hub
USB Device: FaceTime HD Camera (Built-in)
USB Device: USB 2.0 Bus
USB Device: Hub
USB Device: Hub
USB Device: Apple Internal Keyboard / Trackpad
USB Device: BRCM20702 Hub
USB Device: Bluetooth USB Host Controller
USB Device: USB 3.0 Bus
Thunderbolt Bus: MacBook Pro, Apple Inc., 23.4
So after much checking, there isn't anything wrong with my opencl code.
The issue appears to be that the GPU has some kind of heat throttling going on; if it hits 55 degrees Celsius it shuts down, boom. Go Apple.
By downloading smcFanControl and gfxCardStatus, turning the fans to full and keeping an eye on the temperature I've got the panics down to a bearable/manageable occurance.
Not great but maybe I need a better laptop.

Using OpenGL core profile with Mesa 10 and GLFW3

I am running Arch Linux with Mesa 10 on an HP laptop with an Intel HD 3000 GPU. (There is also an ATI card but I shut it off at boot.) I am trying to run OpenGL code with the core profile. OpenGL 3.1 and GLSL 1.4 should be supported according to glxinfo:
-> % glxinfo | grep version
OpenGL core profile version string: 3.1 (Core Profile) Mesa 10.0.1
OpenGL core profile shading language version string: 1.40
OpenGL version string: 3.0 Mesa 10.0.1
OpenGL shading language version string: 1.3
However, when I compile a GLFW program, try to force the core profile, and ask for the OpenGL version like so:
#include <GL/glew.h>
#include <GLFW/glfw3.h>
int main(void)
{
// Use OpenGL 3.1 core profile
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);
glfwWindowHint(GLFW_CONTEXT_REVISION, 0);
// Create opengl context
int window_width = 1024;
int window_height = 768;
GLFWwindow* window = initialize_glfw(window_width, window_height);
if (!window)
{
glfwTerminate();
std::exit(EXIT_FAILURE);
}
// Display OpenGL version
int major, minor, rev, client, forward, profile;
glfwGetVersion(&major, &minor, &rev);
std::cout << "OpenGL - " << major << "." << minor << "." << rev << std::endl;
}
as well as compile shaders with GLSL #version 140, this is the printed output:
-> % ./main
OpenGL - 3.0.3
Shader compilation failed with this message:
0:1(10): error: GLSL 1.40 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES
So, it seems like OpenGL 3.1 and GLSL 1.4 should be supported, but they are not being used in my GLFW program. Can anyone tell me what might be wrong?
After re-reading the documentation, there seem to have been two problems. One, as elmindreda pointed out, is that calling init after making window hints sets the window hints back to their defaults, so init must be called first.
Second, I am using OpenGL 3.1, and the GLFW docs say "If requesting an OpenGL version below 3.2, GLFW_OPENGL_ANY_PROFILE must be used." I was trying to use GLFW_OPENGL_CORE_PROFILE.
You need to initialize GLFW before calling other functions. You also need to make the OpenGL context current before calling functions on it.