View Full Version : BadRequests out the wazoo

10-22-2011, 06:19 PM
Hi, I've been using SDL for awhile and decided to look into OpenGL. It turns out, oddly enough, that when I try to compile ANYTHING now (though I had a working openGL window for awhile there) that I get the following when I run it in terminal:

X Error of failed request: BadRequest (invalid request code or no such operation)
Major opcode of failed request: 135 (GLX)
Minor opcode of failed request: 19 (X_GLXQueryServerString)
Serial number of failed request: 22
Current serial number in output stream: 22

<<That one's from a tutorial I found, but everything I'm trying seems to put that out now. It is very discouraging... Here's the code from that BadRequest, though it happens for everything I try for some reason (out of nowhere):

* green.c
* This program draws a green window. (Yawn!)

#include <GL/gl.h>
#include <GL/glut.h>

void green (void) {


int main(int argc, char** argv)
glutInit(&amp;argc, argv);
glutInitWindowSize(400, 400);
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
glutCreateWindow ("green");

glClearColor (0.0, 1.0, 0.0, 1.0);


My Linker Options under codeblocks are still set to the same things they were when I got my window compiling (this isn't it, etc) and it compiles just fine via terminal, also, but gives me that BadRequest thing when I try to run it in terminal. Any thoughts? @_@;

10-22-2011, 09:20 PM
Everytime the linux kernel is changed ie updates applied then you need to reinstall your proprietary nvidia library. ..at least that is what i have to do on my ubuntu box and using the latest nvidia drivers installed manually.

sudo service gdm stop
sudo sh your_nvidia_driver.run
sudo service gdm start

Then exectute your compiled opengl program and the errors you saw will be gone

10-23-2011, 06:12 AM
Hmm... Trying this for my fglrx-driver doesn't seem to work out. Trying it gives this:

sh: Can't open fglrx-driver

I've tried it logged in as root and as myself, and neither worked.
I'm guessing it might be because of my different driver. @_@;

EDIT: AHA! I found a solution, thanks to some searching inspired by that reply. I found it on my distro's forum (go figure, right?):

sudo apt-get remove --purge fglrx*
sudo apt-get update &amp;&amp; sudo apt-get install fglrx-driver fglrx-control
sudo /usr/bin/aticonfig --initial