Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 244
Vinicius Milani R. Freitas Avatar asked Nov 16 '16 23:11

Vinicius Milani R. Freitas


2 Answers

Adding my user to the video group and rebooting solved the problem for me (source). glxgears now also works. Still have to check if there are other related issues not resolved.

like image 152
sancho.s ReinstateMonicaCellio Avatar answered Nov 19 '22 06:11

sancho.s ReinstateMonicaCellio


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!

like image 10
Mircea Avatar answered Nov 19 '22 07:11

Mircea