X Error of failed request: BadValue (integer parameter out of range for operation)

Vinicius Milani R. Freitas picture Vinicius Milani R. Freitas · Nov 17, 2016 · Viewed 35.3k times · Source

I'm trying to compile and run this c++ code

#include <GL/glut.h>

void displayMe(void)
{
    glClear(GL_COLOR_BUFFER_BIT);
    glBegin(GL_POLYGON);
        glVertex3f(0.0, 0.0, 0.0);
        glVertex3f(0.5, 0.0, 0.0);
        glVertex3f(0.5, 0.5, 0.0);
        glVertex3f(0.0, 0.5, 0.0);
    glEnd();
    glFlush();
}

int main(int argc, char** argv)
{
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_SINGLE);
    glutInitWindowSize(300, 300);
    glutInitWindowPosition(100, 100);
    glutCreateWindow("Hello world :D");
    glutDisplayFunc(displayMe);
    glutMainLoop();
    return 0;
}

which is a "opengl's hello world" I found online. I'm doing this to test my university's NVIDIA Tegra X1, the TX1 development kit is always on and connected to the university's network. I'm connecting to the TX1 via ssh (using the -X flag). Compiling went fine, but when I try to run the program, this error appears:

X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  154 (GLX)
  Minor opcode of failed request:  24 (X_GLXCreateNewContext)
  Value in failed request:  0x0
  Serial number of failed request:  29
  Current serial number in output stream:  30

I haven't found anything online and I have no idea what is going on.

PS: I'm connecting first to my university's network via ssh (using -X) and then I do another ssh to connect to the TX1.

Answer

Mircea picture Mircea · Jul 30, 2018

I was getting errors like this:

X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  151 (GLX)
  Minor opcode of failed request:  24 (X_GLXCreateNewContext)
  Value in failed request:  0x0
  Serial number of failed request:  35
  Current serial number in output stream:  36
name of display: :99

On a remote machine, with nvidia graphics card. Solved the problem by installing the NVIDIA driver from .run file, with the option --no-opengl-files (Inspired from here: https://gist.github.com/wangruohui/df039f0dc434d6486f5d4d098aa52d07)

Hope this helps!