diff --git a/docs/rv-manuals/rv-user-manual/rv-user-manual-chapter-fourteen.md b/docs/rv-manuals/rv-user-manual/rv-user-manual-chapter-fourteen.md index d5e74c759..00fdb0d62 100644 --- a/docs/rv-manuals/rv-user-manual/rv-user-manual-chapter-fourteen.md +++ b/docs/rv-manuals/rv-user-manual/rv-user-manual-chapter-fourteen.md @@ -72,6 +72,7 @@ While high performance playback cannot be guaranteed, these minimum system requi | Component | Recommended Minimum | | --- | --- | | CPU | 64-bit, 6 cores, 12 logical processors | +| GPU | OpenGL support | | Memory (RAM) | 16 GB | | Memory (GPU) | 8 GB | | Storage | RAID or nvme | diff --git a/src/bin/apps/rv/main.cpp b/src/bin/apps/rv/main.cpp index a24e8e820..f6bf5bbfe 100644 --- a/src/bin/apps/rv/main.cpp +++ b/src/bin/apps/rv/main.cpp @@ -787,6 +787,11 @@ int utf8Main(int argc, char* argv[]) TwkGLF::FBOVideoDevice* dummyDev = new TwkGLF::FBOVideoDevice(0, 10, 10, false); IPCore::ImageRenderer::queryGL(); const char* glVersion = (const char*)glGetString(GL_SHADING_LANGUAGE_VERSION); + if (!glVersion) + { + cout << "ERROR: no GPU available: GL_SHADING_LANGUAGE_VERSION query failed" << endl; + exit(-1); + } IPCore::Shader::Function::useShadingLanguageVersion(glVersion); #endif diff --git a/src/bin/imgtools/rvio/main.cpp b/src/bin/imgtools/rvio/main.cpp index 2fd3441e5..b508e0201 100644 --- a/src/bin/imgtools/rvio/main.cpp +++ b/src/bin/imgtools/rvio/main.cpp @@ -985,6 +985,11 @@ int utf8Main(int argc, char* argv[]) #endif IPCore::ImageRenderer::queryGL(); const char* glVersion = (const char*)glGetString(GL_SHADING_LANGUAGE_VERSION); + if (!glVersion) + { + cout << "ERROR: no GPU available: GL_SHADING_LANGUAGE_VERSION query failed" << endl; + exit(-1); + } IPCore::Shader::Function::useShadingLanguageVersion(glVersion); #ifndef PLATFORM_WINDOWS diff --git a/src/lib/graphics/TwkGLFFBO/FBOVideoDevice.cpp b/src/lib/graphics/TwkGLFFBO/FBOVideoDevice.cpp index 235359545..87c0a631c 100644 --- a/src/lib/graphics/TwkGLFFBO/FBOVideoDevice.cpp +++ b/src/lib/graphics/TwkGLFFBO/FBOVideoDevice.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #ifdef PLATFORM_LINUX @@ -154,9 +155,22 @@ namespace TwkGLF int attrs[] = {GLX_BUFFER_SIZE, 32, GLX_RGBA, 0, GLX_STENCIL_SIZE, 1}; m_imp->display = XOpenDisplay(0); + if (!m_imp->display) + { + cout << "ERROR: no GPU available: could not open X display" << endl; + exit(-1); + } + m_imp->root = DefaultRootWindow(m_imp->display); m_imp->vis = glXChooseVisual(m_imp->display, DefaultScreen(m_imp->display), attrs); + if (!m_imp->vis) + { + cout << "ERROR: no GPU available: no matching GLX visual" + << endl; + exit(-1); + } + swa.colormap = XCreateColormap(m_imp->display, m_imp->root, m_imp->vis->visual, AllocNone); swa.event_mask = ExposureMask | KeyPressMask; @@ -166,6 +180,12 @@ namespace TwkGLF m_imp->ctx = glXCreateContext(m_imp->display, m_imp->vis, 0, True); + if (!m_imp->ctx) + { + cout << "ERROR: no GPU available: could not create GLX context" << endl; + exit(-1); + } + glXMakeCurrent(m_imp->display, m_imp->tiny, m_imp->ctx); #endif @@ -241,10 +261,18 @@ namespace TwkGLF SetPixelFormat(m_imp->deviceContext, result, &m_imp->format); m_imp->glContext = wglCreateContext(m_imp->deviceContext); - assert(m_imp->glContext != NULL); + if (!m_imp->glContext) + { + cout << "ERROR: no GPU available: could not create WGL context" << endl; + exit(-1); + } wglMakeCurrent(m_imp->deviceContext, m_imp->glContext); - assert(wglGetCurrentContext() != NULL); + if (!wglGetCurrentContext()) + { + cout << "ERROR: no GPU available: could not activate WGL context" << endl; + exit(-1); + } glewInit(NULL); #endif