# "vtkXOpenGLRenderWindow (0x7fffd7237640): Could not find a decent config"

**URL:** https://discourse.vtk.org/t/vtkxopenglrenderwindow-0x7fffd7237640-could-not-find-a-decent-config/5206
**Category:** Support
**Created:** [February 18, 2021, 9:17am UTC](https://discourse.vtk.org/t/vtkxopenglrenderwindow-0x7fffd7237640-could-not-find-a-decent-config/5206 "2021-02-18T09:17:09Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![fab\_str](https://discourse.vtk.org/user_avatar/discourse.vtk.org/fab_str/32/3024_2.png) [@fab\_str](https://discourse.vtk.org/u/fab_str)
#### Post date: [February 18, 2021, 9:17am UTC](https://discourse.vtk.org/t/vtkxopenglrenderwindow-0x7fffd7237640-could-not-find-a-decent-config/5206/1 "2021-02-18T09:17:10Z")

</div>

I have installed VTK version 8.2 on my WSL1 Ubuntu 20.04.2. I’m running particle tracking simulations, where the final track and geometry should be displayed by the VTK package at the end of the simulation. But instead I get the following error message:

> ERROR: In /home/cstrid/VTK/Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx, line 296  
> vtkXOpenGLRenderWindow (0x7fffd7237640): Could not find a decent config

> ERROR: In /home/cstrid/VTK/Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx, line 296  
> vtkXOpenGLRenderWindow (0x7fffd7237640): Could not find a decent config

> ERROR: In /home/cstrid/VTK/Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx, line 296  
> vtkXOpenGLRenderWindow (0x7fffd7237640): Could not find a decent config

> [KSVISUALIZATION NORMAL MESSAGE] vtk track painter found 1 tracks  
> [KSVISUALIZATION NORMAL MESSAGE] vtk track painter \<track\_painter\> is writing \<1\> cells to file \</home/cstrid/Kassiopeia/install/output/Kassiopeia/track\_painter.vtp\>  
> [KSVISUALIZATION NORMAL MESSAGE] vtk track terminator painter \<terminator\_painter\> is writing \<1\> cells to file \</home/cstrid/Kassiopeia/install/output/Kassiopeia/terminator\_painter.vtp\>  
> [GEOVIS NORMAL MESSAGE] vtk geometry painter \<geometry\_painter\> is writing \<1008\> cells to file \</home/cstrid/Kassiopeia/install/output/Kassiopeia/DipoleTrapGeometry.vtp\>  
> ERROR: In /home/cstrid/VTK/Rendering/OpenGL2/vtkShaderProgram.cxx, line 461  
> vtkShaderProgram (0x7fffd885f960): 1: #version 140  
> 2: #ifdef GL\_ES  
> 3: #ifdef GL\_FRAGMENT\_PRECISION\_HIGH  
> 4: precision highp float;  
> 5: precision highp sampler2D;  
> 6: precision highp sampler3D;  
> 7: #else  
> 8: precision mediump float;  
> 9: precision mediump sampler2D;  
> 10: precision mediump sampler3D;  
> 11: #endif  
> 12: #define texelFetchBuffer texelFetch  
> 13: #define texture1D texture  
> 14: #define texture2D texture  
> 15: #define texture3D texture  
> 16: #else // GL\_ES  
> 17: #define highp  
> 18: #define mediump  
> 19: #define lowp  
> 20: #if **VERSION** == 150  
> 21: #define texelFetchBuffer texelFetch  
> 22: #define texture1D texture  
> 23: #define texture2D texture  
> 24: #define texture3D texture  
> 25: #endif  
> 26: #endif // GL\_ES  
> 27: #define varying in  
> 28:  
> 29:  
> 30: /_=========================================================================  
> 31:  
> 32: Program: Visualization Toolkit  
> 33: Module: vtkPolyDataFS.glsl  
> 34:  
> 35: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen  
> 36: All rights reserved.  
> 37: See Copyright.txt or [http://www.kitware.com/Copyright.htm](http://www.kitware.com/Copyright.htm) for details.  
> 38:  
> 39: This software is distributed WITHOUT ANY WARRANTY; without even  
> 40: the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR  
> 41: PURPOSE. See the above copyright notice for more information.  
> 42:  
> 43: =========================================================================_/  
> 44: // Template for the polydata mappers fragment shader  
> 45:  
> 46: uniform int PrimitiveIDOffset;  
> 47:  
> 48: // VC position of this fragment  
> 49: //VTK::PositionVC::Dec  
> 50:  
> 51: // Camera prop  
> 52: uniform int cameraParallel;  
> 53:  
> 54:  
> 55: // optional color passed in from the vertex shader, vertexColor  
> 56: uniform float ambientIntensity; // the material ambient  
> 57: uniform float diffuseIntensity; // the material diffuse  
> 58: uniform float opacityUniform; // the fragment opacity  
> 59: uniform vec3 ambientColorUniform; // ambient color  
> 60: uniform vec3 diffuseColorUniform; // diffuse color  
> 61: uniform samplerBuffer textureC;  
> 62:  
> 63:  
> 64: // optional surface normal declaration  
> 65: //VTK::Normal::Dec  
> 66:  
> 67: // extra lighting parameters  
> 68: uniform vec3 lightColor0;  
> 69: uniform vec3 lightDirectionVC0; // normalized  
> 70: uniform vec3 lightColor1;  
> 71: uniform vec3 lightDirectionVC1; // normalized  
> 72: uniform vec3 lightColor2;  
> 73: uniform vec3 lightDirectionVC2; // normalized  
> 74: uniform vec3 lightColor3;  
> 75: uniform vec3 lightDirectionVC3; // normalized  
> 76: uniform vec3 lightColor4;  
> 77: uniform vec3 lightDirectionVC4; // normalized  
> 78:  
> 79:  
> 80: // Texture maps  
> 81: //VTK::TMap::Dec  
> 82:  
> 83: // Texture coordinates  
> 84: //VTK::TCoord::Dec  
> 85:  
> 86: // picking support  
> 87: //VTK::Picking::Dec  
> 88:  
> 89: // Depth Peeling Support  
> 90: //VTK::DepthPeeling::Dec  
> 91:  
> 92: // clipping plane vars  
> 93: //VTK::Clip::Dec  
> 94:  
> 95: // the output of this shader  
> 96: out vec4 fragOutput0;  
> 97:  
> 98:  
> 99: // Apple Bug  
> 100: //VTK::PrimID::Dec  
> 101:  
> 102: // handle coincident offsets  
> 103: //VTK::Coincident::Dec  
> 104:  
> 105: // Value raster  
> 106: //VTK::ValuePass::Dec  
> 107:  
> 108: void main()  
> 109: {  
> 110: // VC position of this fragment. This should not branch/return/discard.  
> 111: //VTK::PositionVC::Impl  
> 112:  
> 113: // Place any calls that require uniform flow (e.g. dFdx) here.  
> 114: //VTK::UniformFlow::Impl  
> 115:  
> 116: // Set gl\_FragDepth here (gl\_FragCoord.z by default)  
> 117: //VTK::Depth::Impl  
> 118:  
> 119: // Early depth peeling abort:  
> 120: //VTK::DepthPeeling::PreColor  
> 121:  
> 122: // Apple Bug  
> 123: //VTK::PrimID::Impl  
> 124:  
> 125: //VTK::Clip::Impl  
> 126:  
> 127: //VTK::ValuePass::Impl  
> 128:  
> 129: vec4 texColor = texelFetchBuffer(textureC, gl\_PrimitiveID + PrimitiveIDOffset);  
> 130: vec3 ambientColor = ambientIntensity \* texColor.rgb;  
> 131: vec3 diffuseColor = diffuseIntensity \* texColor.rgb;  
> 132: float opacity = opacityUniform \* texColor.a;  
> 133:  
> 134: // Generate the normal if we are not passed in one  
> 135: //VTK::Normal::Impl  
> 136:  
> 137: fragOutput0 = vec4(ambientColor + diffuseColor, opacity);  
> 138: //VTK::Light::Impl  
> 139:  
> 140:  
> 141: //VTK::TCoord::Impl  
> 142:  
> 143: if (fragOutput0.a \<= 0.0)  
> 144: {  
> 145: discard;  
> 146: }  
> 147:  
> 148: //VTK::DepthPeeling::Impl  
> 149:  
> 150: //VTK::Picking::Impl  
> 151:  
> 152: // handle coincident offsets  
> 153: //VTK::Coincident::Impl  
> 154: }

> ERROR: In /home/cstrid/VTK/Rendering/OpenGL2/vtkShaderProgram.cxx, line 462  
> vtkShaderProgram (0x7fffd885f960): 0:129(45): error: `gl_PrimitiveID' undeclared 0:129(45): error: operands to arithmetic operators must be numeric 0:129(18): error: no function with name 'texelFetchBuffer' 0:130(41): warning: `texColor’ used uninitialized  
> 0:131(41): warning: `texColor' used uninitialized 0:132(35): warning: `texColor’ used uninitialized

> ERROR: In /home/cstrid/VTK/Rendering/OpenGL2/vtkTextureObject.cxx, line 1991  
> vtkTextureObject (0x7fffd8b2e6e0): failed at glCopyTexImage2D 36012 1 OpenGL errors detected  
> 0 : (1282) Invalid operation

> ERROR: In /home/cstrid/VTK/Rendering/OpenGL2/vtkShaderProgram.cxx, line 461  
> vtkShaderProgram (0x7fffd9646be0): 1: #version 140  
> 2: #ifdef GL\_ES  
> 3: #ifdef GL\_FRAGMENT\_PRECISION\_HIGH  
> 4: precision highp float;  
> 5: precision highp sampler2D;  
> 6: precision highp sampler3D;  
> 7: #else  
> 8: precision mediump float;  
> 9: precision mediump sampler2D;  
> 10: precision mediump sampler3D;  
> 11: #endif  
> 12: #define texelFetchBuffer texelFetch  
> 13: #define texture1D texture  
> 14: #define texture2D texture  
> 15: #define texture3D texture  
> 16: #else // GL\_ES  
> 17: #define highp  
> 18: #define mediump  
> 19: #define lowp  
> 20: #if **VERSION** == 150  
> 21: #define texelFetchBuffer texelFetch  
> 22: #define texture1D texture  
> 23: #define texture2D texture  
> 24: #define texture3D texture  
> 25: #endif  
> 26: #endif // GL\_ES  
> 27: #define varying in  
> 28:  
> 29:  
> 30: /_=========================================================================  
> 31:  
> 32: Program: Visualization Toolkit  
> 33: Module: vtkPolyDataFS.glsl  
> 34:  
> 35: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen  
> 36: All rights reserved.  
> 37: See Copyright.txt or [http://www.kitware.com/Copyright.htm](http://www.kitware.com/Copyright.htm) for details.  
> 38:  
> 39: This software is distributed WITHOUT ANY WARRANTY; without even  
> 40: the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR  
> 41: PURPOSE. See the above copyright notice for more information.  
> 42:  
> 43: =========================================================================_/  
> 44: // Template for the polydata mappers fragment shader  
> 45:  
> 46: uniform int PrimitiveIDOffset;  
> 47:  
> 48: // VC position of this fragment  
> 49: in vec4 vertexVCVSOutput;  
> 50:  
> 51: // Camera prop  
> 52: uniform int cameraParallel;  
> 53:  
> 54:  
> 55: // optional color passed in from the vertex shader, vertexColor  
> 56: uniform float ambientIntensity; // the material ambient  
> 57: uniform float diffuseIntensity; // the material diffuse  
> 58: uniform float opacityUniform; // the fragment opacity  
> 59: uniform vec3 ambientColorUniform; // ambient color  
> 60: uniform vec3 diffuseColorUniform; // diffuse color  
> 61: uniform float specularIntensity; // the material specular intensity  
> 62: uniform vec3 specularColorUniform; // intensity weighted color  
> 63: uniform float specularPowerUniform;  
> 64: uniform samplerBuffer textureC;  
> 65:  
> 66:  
> 67: // optional surface normal declaration  
> 68: //VTK::Normal::Dec  
> 69:  
> 70: // extra lighting parameters  
> 71: uniform vec3 lightColor0;  
> 72: uniform vec3 lightDirectionVC0; // normalized  
> 73: uniform vec3 lightColor1;  
> 74: uniform vec3 lightDirectionVC1; // normalized  
> 75: uniform vec3 lightColor2;  
> 76: uniform vec3 lightDirectionVC2; // normalized  
> 77: uniform vec3 lightColor3;  
> 78: uniform vec3 lightDirectionVC3; // normalized  
> 79: uniform vec3 lightColor4;  
> 80: uniform vec3 lightDirectionVC4; // normalized  
> 81:  
> 82:  
> 83: // Texture maps  
> 84: //VTK::TMap::Dec  
> 85:  
> 86: // Texture coordinates  
> 87: //VTK::TCoord::Dec  
> 88:  
> 89: // picking support  
> 90: //VTK::Picking::Dec  
> 91:  
> 92: // Depth Peeling Support  
> 93: uniform sampler2D opaqueDepth;  
> 94:  
> 95:  
> 96: // clipping plane vars  
> 97: //VTK::Clip::Dec  
> 98:  
> 99: // the output of this shader  
> 100: out vec4 fragOutput0;  
> 101: out vec4 fragOutput1;  
> 102:  
> 103:  
> 104: // Apple Bug  
> 105: //VTK::PrimID::Dec  
> 106:  
> 107: // handle coincident offsets  
> 108: //VTK::Coincident::Dec  
> 109:  
> 110: // Value raster  
> 111: //VTK::ValuePass::Dec  
> 112:  
> 113: void main()  
> 114: {  
> 115: // VC position of this fragment. This should not branch/return/discard.  
> 116: vec4 vertexVC = vertexVCVSOutput;  
> 117:  
> 118: // Place any calls that require uniform flow (e.g. dFdx) here.  
> 119: vec3 fdx = vec3(dFdx(vertexVC.x),dFdx(vertexVC.y),dFdx(vertexVC.z));  
> 120: vec3 fdy = vec3(dFdy(vertexVC.x),dFdy(vertexVC.y),dFdy(vertexVC.z));  
> 121: //VTK::UniformFlow::Impl  
> 122:  
> 123:  
> 124: // Set gl\_FragDepth here (gl\_FragCoord.z by default)  
> 125: gl\_FragDepth = gl\_FragCoord.z;  
> 126:  
> 127: // Early depth peeling abort:  
> 128: ivec2 pixel = ivec2(gl\_FragCoord.xy);  
> 129: float oDepth = texelFetch(opaqueDepth, pixel, 0).y;  
> 130: if (oDepth != -1. && gl\_FragDepth \> oDepth)  
> 131: { // Ignore fragments that are occluded by opaque geometry:  
> 132: fragOutput1.xy = vec2(-1., oDepth);  
> 133: return;  
> 134: }  
> 135: else  
> 136: {  
> 137: fragOutput1.xy = vec2(-gl\_FragDepth, gl\_FragDepth);  
> 138: return;  
> 139: }  
> 140:  
> 141:  
> 142: // Apple Bug  
> 143: //VTK::PrimID::Impl  
> 144:  
> 145: //VTK::Clip::Impl  
> 146:  
> 147: //VTK::ValuePass::Impl  
> 148:  
> 149: vec3 specularColor = specularIntensity \* specularColorUniform;  
> 150: float specularPower = specularPowerUniform;  
> 151: vec4 texColor = texelFetchBuffer(textureC, gl\_PrimitiveID + PrimitiveIDOffset);  
> 152: vec3 ambientColor = ambientIntensity \* texColor.rgb;  
> 153: vec3 diffuseColor = diffuseIntensity \* texColor.rgb;  
> 154: float opacity = opacityUniform \* texColor.a;  
> 155:  
> 156: // Generate the normal if we are not passed in one  
> 157: fdx = normalize(fdx);  
> 158: fdy = normalize(fdy);  
> 159: vec3 normalVCVSOutput = normalize(cross(fdx,fdy));  
> 160: if (cameraParallel == 1 && normalVCVSOutput.z \< 0.0) { normalVCVSOutput = -1.0_normalVCVSOutput; }  
> 161: if (cameraParallel == 0 && dot(normalVCVSOutput,vertexVC.xyz) \> 0.0) { normalVCVSOutput = -1.0_normalVCVSOutput; }  
> 162:  
> 163: vec3 diffuse = vec3(0,0,0);  
> 164: vec3 specular = vec3(0,0,0);  
> 165: float df;  
> 166: float sf;  
> 167: df = max(0.0, dot(normalVCVSOutput, -lightDirectionVC0));  
> 168: diffuse += (df \* lightColor0);  
> 169: sf = sign(df)\*pow(max(0.0, dot( reflect(lightDirectionVC0, normalVCVSOutput), normalize(-vertexVC.xyz))), specularPower);  
> 170: specular += (sf \* lightColor0);  
> 171: df = max(0.0, dot(normalVCVSOutput, -lightDirectionVC1));  
> 172: diffuse += (df \* lightColor1);  
> 173: sf = sign(df)\*pow(max(0.0, dot( reflect(lightDirectionVC1, normalVCVSOutput), normalize(-vertexVC.xyz))), specularPower);  
> 174: specular += (sf \* lightColor1);  
> 175: df = max(0.0, dot(normalVCVSOutput, -lightDirectionVC2));  
> 176: diffuse += (df \* lightColor2);  
> 177: sf = sign(df)\*pow(max(0.0, dot( reflect(lightDirectionVC2, normalVCVSOutput), normalize(-vertexVC.xyz))), specularPower);  
> 178: specular += (sf \* lightColor2);  
> 179: df = max(0.0, dot(normalVCVSOutput, -lightDirectionVC3));  
> 180: diffuse += (df \* lightColor3);  
> 181: sf = sign(df)\*pow(max(0.0, dot( reflect(lightDirectionVC3, normalVCVSOutput), normalize(-vertexVC.xyz))), specularPower);  
> 182: specular += (sf \* lightColor3);  
> 183: df = max(0.0, dot(normalVCVSOutput, -lightDirectionVC4));  
> 184: diffuse += (df \* lightColor4);  
> 185: sf = sign(df)\*pow(max(0.0, dot( reflect(lightDirectionVC4, normalVCVSOutput), normalize(-vertexVC.xyz))), specularPower);  
> 186: specular += (sf \* lightColor4);  
> 187: diffuse = diffuse \* diffuseColor;  
> 188: specular = specular \* specularColor;  
> 189: fragOutput0 = vec4(ambientColor + diffuse + specular, opacity); //VTK::Light::Impl  
> 190:  
> 191: //VTK::TCoord::Impl  
> 192:  
> 193: if (fragOutput0.a \<= 0.0)  
> 194: {  
> 195: discard;  
> 196: }  
> 197:  
> 198: //VTK::DepthPeeling::Impl  
> 199:  
> 200: //VTK::Picking::Impl  
> 201:  
> 202: // handle coincident offsets  
> 203: //VTK::Coincident::Impl  
> 204: }

> ERROR: In /home/cstrid/VTK/Rendering/OpenGL2/vtkShaderProgram.cxx, line 462  
> vtkShaderProgram (0x7fffd9646be0): 0:151(45): error: `gl_PrimitiveID' undeclared 0:151(45): error: operands to arithmetic operators must be numeric 0:151(18): error: no function with name 'texelFetchBuffer' 0:152(41): warning: `texColor’ used uninitialized  
> 0:153(41): warning: `texColor' used uninitialized 0:154(35): warning: `texColor’ used uninitialized

> ERROR: In /home/cstrid/VTK/Rendering/OpenGL2/vtkShaderProgram.cxx, line 461  
> vtkShaderProgram (0x7fffd965b5b0): 1: #version 140  
> 2: #ifdef GL\_ES  
> 3: #ifdef GL\_FRAGMENT\_PRECISION\_HIGH  
> 4: precision highp float;  
> 5: precision highp sampler2D;  
> 6: precision highp sampler3D;  
> 7: #else  
> 8: precision mediump float;  
> 9: precision mediump sampler2D;  
> 10: precision mediump sampler3D;  
> 11: #endif  
> 12: #define texelFetchBuffer texelFetch  
> 13: #define texture1D texture  
> 14: #define texture2D texture  
> 15: #define texture3D texture  
> 16: #else // GL\_ES  
> 17: #define highp  
> 18: #define mediump  
> 19: #define lowp  
> 20: #if **VERSION** == 150  
> 21: #define texelFetchBuffer texelFetch  
> 22: #define texture1D texture  
> 23: #define texture2D texture  
> 24: #define texture3D texture  
> 25: #endif  
> 26: #endif // GL\_ES  
> 27: #define varying in  
> 28:  
> 29:  
> 30: /_=========================================================================  
> 31:  
> 32: Program: Visualization Toolkit  
> 33: Module: vtkPolyDataFS.glsl  
> 34:  
> 35: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen  
> 36: All rights reserved.  
> 37: See Copyright.txt or [http://www.kitware.com/Copyright.htm](http://www.kitware.com/Copyright.htm) for details.  
> 38:  
> 39: This software is distributed WITHOUT ANY WARRANTY; without even  
> 40: the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR  
> 41: PURPOSE. See the above copyright notice for more information.  
> 42:  
> 43: =========================================================================_/  
> 44: // Template for the polydata mappers fragment shader  
> 45:  
> 46: uniform int PrimitiveIDOffset;  
> 47:  
> 48: // VC position of this fragment  
> 49: in vec4 vertexVCVSOutput;  
> 50:  
> 51: // Camera prop  
> 52: uniform int cameraParallel;  
> 53:  
> 54:  
> 55: // optional color passed in from the vertex shader, vertexColor  
> 56: uniform float ambientIntensity; // the material ambient  
> 57: uniform float diffuseIntensity; // the material diffuse  
> 58: uniform float opacityUniform; // the fragment opacity  
> 59: uniform vec3 ambientColorUniform; // ambient color  
> 60: uniform vec3 diffuseColorUniform; // diffuse color  
> 61: uniform float specularIntensity; // the material specular intensity  
> 62: uniform vec3 specularColorUniform; // intensity weighted color  
> 63: uniform float specularPowerUniform;  
> 64: uniform samplerBuffer textureC;  
> 65:  
> 66:  
> 67: // optional surface normal declaration  
> 68: //VTK::Normal::Dec  
> 69:  
> 70: // extra lighting parameters  
> 71: uniform vec3 lightColor0;  
> 72: uniform vec3 lightDirectionVC0; // normalized  
> 73: uniform vec3 lightColor1;  
> 74: uniform vec3 lightDirectionVC1; // normalized  
> 75: uniform vec3 lightColor2;  
> 76: uniform vec3 lightDirectionVC2; // normalized  
> 77: uniform vec3 lightColor3;  
> 78: uniform vec3 lightDirectionVC3; // normalized  
> 79: uniform vec3 lightColor4;  
> 80: uniform vec3 lightDirectionVC4; // normalized  
> 81:  
> 82:  
> 83: // Texture maps  
> 84: //VTK::TMap::Dec  
> 85:  
> 86: // Texture coordinates  
> 87: //VTK::TCoord::Dec  
> 88:  
> 89: // picking support  
> 90: //VTK::Picking::Dec  
> 91:  
> 92: // Depth Peeling Support  
> 93: uniform sampler2D lastFrontPeel;  
> 94: uniform sampler2D lastDepthPeel;  
> 95:  
> 96:  
> 97: // clipping plane vars  
> 98: //VTK::Clip::Dec  
> 99:  
> 100: // the output of this shader  
> 101: out vec4 fragOutput0;  
> 102: out vec4 fragOutput1;  
> 103: out vec4 fragOutput2;  
> 104:  
> 105:  
> 106: // Apple Bug  
> 107: //VTK::PrimID::Dec  
> 108:  
> 109: // handle coincident offsets  
> 110: //VTK::Coincident::Dec  
> 111:  
> 112: // Value raster  
> 113: //VTK::ValuePass::Dec  
> 114:  
> 115: void main()  
> 116: {  
> 117: // VC position of this fragment. This should not branch/return/discard.  
> 118: vec4 vertexVC = vertexVCVSOutput;  
> 119:  
> 120: // Place any calls that require uniform flow (e.g. dFdx) here.  
> 121: vec3 fdx = vec3(dFdx(vertexVC.x),dFdx(vertexVC.y),dFdx(vertexVC.z));  
> 122: vec3 fdy = vec3(dFdy(vertexVC.x),dFdy(vertexVC.y),dFdy(vertexVC.z));  
> 123: //VTK::UniformFlow::Impl  
> 124:  
> 125:  
> 126: // Set gl\_FragDepth here (gl\_FragCoord.z by default)  
> 127: gl\_FragDepth = gl\_FragCoord.z;  
> 128:  
> 129: // Early depth peeling abort:  
> 130: ivec2 pixelCoord = ivec2(gl\_FragCoord.xy);  
> 131: vec4 front = texelFetch(lastFrontPeel, pixelCoord, 0);  
> 132: vec2 minMaxDepth = texelFetch(lastDepthPeel, pixelCoord, 0).xy;  
> 133: float minDepth = -minMaxDepth.x;  
> 134: float maxDepth = minMaxDepth.y;  
> 135: // Use a tolerance when checking if we’re on a current peel.  
> 136: // Some OSX drivers compute slightly different fragment depths  
> 137: // from one pass to the next. This value was determined  
> 138: // through trial-and-error – it may need to be increased at  
> 139: // some point. See also the comment in vtkDepthPeelingPass’s  
> 140: // shader.  
> 141: float epsilon = 0.0000001;  
> 142:  
> 143: // Default outputs (no data/change):  
> 144: fragOutput0 = vec4(0.);  
> 145: fragOutput1 = front;  
> 146: fragOutput2.xy = vec2(-1.);  
> 147:  
> 148: // Is this fragment outside the current peels?  
> 149: if (gl\_FragDepth \< minDepth - epsilon ||  
> 150: gl\_FragDepth \> maxDepth + epsilon)  
> 151: {  
> 152: return;  
> 153: }  
> 154:  
> 155: // Is this fragment inside the current peels?  
> 156: if (gl\_FragDepth \> minDepth + epsilon &&  
> 157: gl\_FragDepth \< maxDepth - epsilon)  
> 158: {  
> 159: // Write out depth so this frag will be peeled later:  
> 160: fragOutput2.xy = vec2(-gl\_FragDepth, gl\_FragDepth);  
> 161: return;  
> 162: }  
> 163:  
> 164: // Continue processing for fragments on the current peel:  
> 165:  
> 166:  
> 167: // Apple Bug  
> 168: //VTK::PrimID::Impl  
> 169:  
> 170: //VTK::Clip::Impl  
> 171:  
> 172: //VTK::ValuePass::Impl  
> 173:  
> 174: vec3 specularColor = specularIntensity \* specularColorUniform;  
> 175: float specularPower = specularPowerUniform;  
> 176: vec4 texColor = texelFetchBuffer(textureC, gl\_PrimitiveID + PrimitiveIDOffset);  
> 177: vec3 ambientColor = ambientIntensity \* texColor.rgb;  
> 178: vec3 diffuseColor = diffuseIntensity \* texColor.rgb;  
> 179: float opacity = opacityUniform \* texColor.a;  
> 180:  
> 181: // Generate the normal if we are not passed in one  
> 182: fdx = normalize(fdx);  
> 183: fdy = normalize(fdy);  
> 184: vec3 normalVCVSOutput = normalize(cross(fdx,fdy));  
> 185: if (cameraParallel == 1 && normalVCVSOutput.z \< 0.0) { normalVCVSOutput = -1.0_normalVCVSOutput; }  
> 186: if (cameraParallel == 0 && dot(normalVCVSOutput,vertexVC.xyz) \> 0.0) { normalVCVSOutput = -1.0_normalVCVSOutput; }  
> 187:  
> 188: vec3 diffuse = vec3(0,0,0);  
> 189: vec3 specular = vec3(0,0,0);  
> 190: float df;  
> 191: float sf;  
> 192: df = max(0.0, dot(normalVCVSOutput, -lightDirectionVC0));  
> 193: diffuse += (df \* lightColor0);  
> 194: sf = sign(df)\*pow(max(0.0, dot( reflect(lightDirectionVC0, normalVCVSOutput), normalize(-vertexVC.xyz))), specularPower);  
> 195: specular += (sf \* lightColor0);  
> 196: df = max(0.0, dot(normalVCVSOutput, -lightDirectionVC1));  
> 197: diffuse += (df \* lightColor1);  
> 198: sf = sign(df)\*pow(max(0.0, dot( reflect(lightDirectionVC1, normalVCVSOutput), normalize(-vertexVC.xyz))), specularPower);  
> 199: specular += (sf \* lightColor1);  
> 200: df = max(0.0, dot(normalVCVSOutput, -lightDirectionVC2));  
> 201: diffuse += (df \* lightColor2);  
> 202: sf = sign(df)\*pow(max(0.0, dot( reflect(lightDirectionVC2, normalVCVSOutput), normalize(-vertexVC.xyz))), specularPower);  
> 203: specular += (sf \* lightColor2);  
> 204: df = max(0.0, dot(normalVCVSOutput, -lightDirectionVC3));  
> 205: diffuse += (df \* lightColor3);  
> 206: sf = sign(df)\*pow(max(0.0, dot( reflect(lightDirectionVC3, normalVCVSOutput), normalize(-vertexVC.xyz))), specularPower);  
> 207: specular += (sf \* lightColor3);  
> 208: df = max(0.0, dot(normalVCVSOutput, -lightDirectionVC4));  
> 209: diffuse += (df \* lightColor4);  
> 210: sf = sign(df)\*pow(max(0.0, dot( reflect(lightDirectionVC4, normalVCVSOutput), normalize(-vertexVC.xyz))), specularPower);  
> 211: specular += (sf \* lightColor4);  
> 212: diffuse = diffuse \* diffuseColor;  
> 213: specular = specular \* specularColor;  
> 214: fragOutput0 = vec4(ambientColor + diffuse + specular, opacity); //VTK::Light::Impl  
> 215:  
> 216: //VTK::TCoord::Impl  
> 217:  
> 218: if (fragOutput0.a \<= 0.0)  
> 219: {  
> 220: discard;  
> 221: }  
> 222:  
> 223: vec4 frag = fragOutput0;  
> 224: // Default outputs (no data/change):  
> 225:  
> 226: // This fragment is on a current peel:  
> 227: if (gl\_FragDepth \>= minDepth - epsilon &&  
> 228: gl\_FragDepth \<= minDepth + epsilon)  
> 229: { // Front peel:  
> 230: // Clear the back color:  
> 231: fragOutput0 = vec4(0.);  
> 232:  
> 233: // We store the front alpha value as (1-alpha) to allow MAX  
> 234: // blending. This also means it is really initialized to 1,  
> 235: // as it should be for under-blending.  
> 236: front.a = 1. - front.a;  
> 237:  
> 238: // Use under-blending to combine fragment with front color:  
> 239: fragOutput1.rgb = front.a \* frag.a \* frag.rgb + front.rgb;  
> 240: // Write out (1-alpha):  
> 241: fragOutput1.a = 1. - (front.a \* (1. - frag.a));  
> 242: }  
> 243: else // (gl\_FragDepth == maxDepth)  
> 244: { // Back peel:  
> 245: // Dump premultiplied fragment, it will be blended later:  
> 246: frag.rgb \*= frag.a;  
> 247: fragOutput0 = frag;  
> 248: }  
> 249:  
> 250:  
> 251: //VTK::Picking::Impl  
> 252:  
> 253: // handle coincident offsets  
> 254: //VTK::Coincident::Impl  
> 255: }

> ERROR: In /home/cstrid/VTK/Rendering/OpenGL2/vtkShaderProgram.cxx, line 462  
> vtkShaderProgram (0x7fffd965b5b0): 0:176(45): error: `gl_PrimitiveID' undeclared 0:176(45): error: operands to arithmetic operators must be numeric 0:176(18): error: no function with name 'texelFetchBuffer' 0:177(41): warning: `texColor’ used uninitialized  
> 0:178(41): warning: `texColor' used uninitialized 0:179(35): warning: `texColor’ used uninitialized

> [KSMAIN NORMAL MESSAGE] starting…  
> [KSMAIN NORMAL MESSAGE] …finished

I have installed Ubuntu on my windows 10 laptop computer (Graphic card: NVIDIA GeForce MX130 and Intel® UHD Graphics) and I also have Xming installed. What is causing the problem and how to fix it?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [February 18, 2021, 9:20am UTC](https://discourse.vtk.org/t/vtkxopenglrenderwindow-0x7fffd7237640-could-not-find-a-decent-config/5206/2 "2021-02-18T09:20:16Z")

</div>

> [@Any guides for building VTK on Ubuntu 18.04 using WSL?](https://discourse.vtk.org/t/any-guides-for-building-vtk-on-ubuntu-18-04-using-wsl/2999):
>
> Hello! I am trying to build VTK 8.1 for Linux basically in WSL, because I want to incorporate this functionality showcasen here in my own code; [https://lorensen.github.io/VTKExamples/site/Cxx/IO/WriteVTP/](https://lorensen.github.io/VTKExamples/site/Cxx/IO/WriteVTP/) I am struggling quite a bit, since I am able to build it succesfully and find some of the header files, but for some reason some files like; vtkCommonCoreModule.h vtkCommonDataModelModule.h Are not found and I am pretty clueless to why that would be the case? I am able to find all of th…

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [February 18, 2021, 12:53pm UTC](https://discourse.vtk.org/t/vtkxopenglrenderwindow-0x7fffd7237640-could-not-find-a-decent-config/5206/3 "2021-02-18T12:53:29Z")

</div>

I tried running VTK-based applications with a GUI on WSL2 a few days ago and everything worked perfectly:

> **[Slicer can be built and runs well on Windows Subsystem for Linux (WSL2)](https://discourse.slicer.org/t/slicer-can-be-built-and-runs-well-on-windows-subsystem-for-linux-wsl2/16022)**
>
> Some information for Windows developers who want to develop/test Slicer on Linux. On current Windows 10 versions, it is very easy to install Linux and run Linux GUI applications such as Slicer, by using Windows Subsystem for Linux (WSL2). Ubuntu...

I’ve followed these instructions for setting up the GUI desktop (it is much simpler than most other tutorials that I’ve found, you just need to copy-paste 10-20 lines of code to the console):

> **[How To Enable WSL2 Ubuntu GUI and use RDP to Remote - NEXTOFWINDOWS.COM](https://www.nextofwindows.com/how-to-enable-wsl2-ubuntu-gui-and-use-rdp-to-remote)**
>
> WSL2 continues to be one of my top features I want to explore and learn more about in the entire Windows 10 offering. What Microsoft is doing with WSL is

---

<div class="post-metadata">

### Author: ![fab\_str](https://discourse.vtk.org/user_avatar/discourse.vtk.org/fab_str/32/3024_2.png) [@fab\_str](https://discourse.vtk.org/u/fab_str)
#### Post date: [February 18, 2021, 5:08pm UTC](https://discourse.vtk.org/t/vtkxopenglrenderwindow-0x7fffd7237640-could-not-find-a-decent-config/5206/4 "2021-02-18T17:08:44Z")

</div>

There is nothing wrong with my vtk installation. Something is wrong with the opengl2 or something, I’m not sure.

---

<div class="post-metadata">

### Author: ![fab\_str](https://discourse.vtk.org/user_avatar/discourse.vtk.org/fab_str/32/3024_2.png) [@fab\_str](https://discourse.vtk.org/u/fab_str)
#### Post date: [February 22, 2021, 9:25am UTC](https://discourse.vtk.org/t/vtkxopenglrenderwindow-0x7fffd7237640-could-not-find-a-decent-config/5206/5 "2021-02-22T09:25:12Z")

</div>

So I have followed the instructions given here:  
[VTK - Users - For those using OpenGL2 in the VTK build. (nabble.com)](http://vtk.1045678.n5.nabble.com/For-those-using-OpenGL2-in-the-VTK-build-td5732488.html)  
But the problem persists. Is there something that I would need to install besides the Xming?

---

<div class="post-metadata">

### Author: ![fab\_str](https://discourse.vtk.org/user_avatar/discourse.vtk.org/fab_str/32/3024_2.png) [@fab\_str](https://discourse.vtk.org/u/fab_str)
#### Post date: [February 22, 2021, 10:07am UTC](https://discourse.vtk.org/t/vtkxopenglrenderwindow-0x7fffd7237640-could-not-find-a-decent-config/5206/6 "2021-02-22T10:07:27Z")

</div>

But I have WSL1

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [February 22, 2021, 5:50pm UTC](https://discourse.vtk.org/t/vtkxopenglrenderwindow-0x7fffd7237640-could-not-find-a-decent-config/5206/7 "2021-02-22T17:50:26Z")

</div>

Is there a specific reason not to upgrade to WSL2? As I wrote above, you can very easily set up WSL2 to run GUI applications, including complex VTK-based applications. You don’t even need Xming, but you can simply use standard Windows remote desktop client.

---

<div class="post-metadata">

### Author: ![fab\_str](https://discourse.vtk.org/user_avatar/discourse.vtk.org/fab_str/32/3024_2.png) [@fab\_str](https://discourse.vtk.org/u/fab_str)
#### Post date: [February 22, 2021, 6:28pm UTC](https://discourse.vtk.org/t/vtkxopenglrenderwindow-0x7fffd7237640-could-not-find-a-decent-config/5206/8 "2021-02-22T18:28:21Z")

</div>

Yes, I’m using the Kassiopeia package which requires WSL1. Xming is needed for the root program.

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [February 22, 2021, 6:41pm UTC](https://discourse.vtk.org/t/vtkxopenglrenderwindow-0x7fffd7237640-could-not-find-a-decent-config/5206/9 "2021-02-22T18:41:11Z")

</div>

> [@fab\_str](#):
>
> I’m using the Kassiopeia package which requires WSL1

What is Kassiopeia? WSL1 will be phased out, so probably Kassiopeia developers are already working on WSL2 compatibility and may already have at least a development version that you can use on WSL2.

> [@fab\_str](#):
>
> Xming is needed for the root program.

What is this “root program”? Is there anything preventing you from using xrdp?

---

<div class="post-metadata">

### Author: ![fab\_str](https://discourse.vtk.org/user_avatar/discourse.vtk.org/fab_str/32/3024_2.png) [@fab\_str](https://discourse.vtk.org/u/fab_str)
#### Post date: [February 23, 2021, 8:04am UTC](https://discourse.vtk.org/t/vtkxopenglrenderwindow-0x7fffd7237640-could-not-find-a-decent-config/5206/10 "2021-02-23T08:04:16Z")

</div>

Correctly it was vtk that requires WSL1, not kassiopeia. Kassiopeia is a particle tracking software. I got this error message when I’m using WSL2:

```
ERROR: In /home/cstrid/VTK/Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx, line 277
vtkXOpenGLRenderWindow (0x564cff91d130): bad X server connection. DISPLAY=localhost:0.0.   
Aborting.

Aborted
```

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [February 23, 2021, 4:39pm UTC](https://discourse.vtk.org/t/vtkxopenglrenderwindow-0x7fffd7237640-could-not-find-a-decent-config/5206/11 "2021-02-23T16:39:13Z")

</div>

You can set up the X server correctly (so that it works well with VTK) as described in the tutorial that I linked [above](https://discourse.vtk.org/t/vtkxopenglrenderwindow-0x7fffd7237640-could-not-find-a-decent-config/5206/3). There are dozens of similar tutorials out there, I just mention this one, because it is proven to work with VTK and it is much easier compared to the others that I found.

---

<div class="post-metadata">

### Author: ![fab\_str](https://discourse.vtk.org/user_avatar/discourse.vtk.org/fab_str/32/3024_2.png) [@fab\_str](https://discourse.vtk.org/u/fab_str)
#### Post date: [February 24, 2021, 8:05am UTC](https://discourse.vtk.org/t/vtkxopenglrenderwindow-0x7fffd7237640-could-not-find-a-decent-config/5206/13 "2021-02-24T08:05:43Z")

</div>

I followed this tutorial [How To Enable WSL2 Ubuntu GUI and use RDP to Remote - NEXTOFWINDOWS.COM](https://www.nextofwindows.com/how-to-enable-wsl2-ubuntu-gui-and-use-rdp-to-remote?unapproved=255624&moderation-hash=e949e7b26370d70942a36aaa25393f06#comment-255624), and I have enabled RDP to remote access. Should I now run vtk on the RDP ?

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [February 24, 2021, 12:28pm UTC](https://discourse.vtk.org/t/vtkxopenglrenderwindow-0x7fffd7237640-could-not-find-a-decent-config/5206/14 "2021-02-24T12:28:16Z")

</div>

You can run VTK applications with interactive GUI using the remote desktop client. I guess it should be possible to use VTK via a WSL2 terminal, but probably you need to set the DISPLAY variable, something like this:

```
export DISPLAY=local:0.0
```
