33

I have two two graphic card on board, one is the integrating in Intel cpu, one is the nvidia card.

I want use the integrating one to render desktop, the NV card to calculate with cuda. I switch to use the integrating one in "NVIDIA X Server settings", after I installed the "nvidia-modprobe" it's worked as i want.

but where is a issue with glx, when i run glxinfo.

name of display: :0
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:  37
Current serial number in output stream:  38

In the xorg log it libglx.so in

[     3.597] (II) "glx" will be loaded by default.
[     3.597] (II) LoadModule: "glx"
[     3.599] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[     3.612] (II) Module glx: vendor="X.Org Foundation"

Is there a way i can get the glx runing correctly?

7 Answers 7

13

Solved, I have setup what I want. I posted the answer shown below at GitHub.

  1. Remove all Nvidia packages and reinstall xorg packages.

    sudo apt-get purge nvidia*  
    sudo apt-get install --reinstall xserver-xorg-video-intel libgl1-mesa-glx libgl1-mesa-dri xserver-xorg-core   
    sudo dpkg-reconfigure xserver-xorg   
    
  2. Install cuda8. You need to:

    Press Crtl + Alt + F1 keys.

    sudo service lightdm stop  
    sudo init 3  
    

    I use cuda8 .run file to install it, then installing it will prompt if you want to install nvidia card driver?.

    Choose yes.

    It will prompt if you want to install nvidia opengl?

    Choose no, this is a crucial choice, if you say "yes" here it will cover "mesa*" libraries.

    After this, choose the default.

    After install, reboot.

    sudo reboot
    
5
  • 8
    Follow up to this - I got a similar error caused by graphics updates. A simple reboot fixed it for my computer without needing to uninstall/reinstall nvidia drivers.
    – Pterosaur
    May 10, 2017 at 15:06
  • 1
    Indeed that seems a lot of work that may not be necessary ... Had a similar problem, and had to fix the key mod number (used Mod1 instead of Mod4)
    – Déjà vu
    Oct 20, 2017 at 8:34
  • I had a similar error running wine OpenGL applications (glxgears and glxinfo were running without any problem) and the solution has been simply to upgrade from nvidia-410 (Ubuntu 18.04) to nvidia-415 (found on the "graphics drivers" ppa, version 415.27-0ubuntu0~gpu18.04.1). Hope this may help someone in the future.
    – Avio
    Feb 4, 2019 at 13:40
  • @e2-e4, could you explain how to "fix the key mod number (used Mod1 instead of Mod4)"? Oct 12, 2020 at 0:23
  • @user2707671 Sorry it was on a laptop with Ubuntu 16 that I'm not using anymore. Used xmodmap, Maybe superuser.com/questions/1057269/… can help?
    – Déjà vu
    Oct 12, 2020 at 0:40
6

For anyone arriving at this question trying to use OpenGL on a headless server: you might also get this message if you have NVIDIA GLX drivers installed but don't actually have an NVIDIA card in your server (e.g. if using the AWS Deep Learning Base AMI on a machine without a GPU).

To confirm, try running an X server with +iglx (which should allow glxinfo to run), and see whether glxinfo output (e.g. xvfb-run -s '-screen 0 1400x900x24 +iglx' glxinfo) reports client glx vendor string: NVIDIA Corporation. If it does, try switching to an AMI without any NVIDIA stuff.

4

Downgrade the NVIDIA driver to 340.12

Previously was 384.11 by default.

This can be done easily from the software-properties-gtk "additional drivers" tab.

Then reboot.

Ubuntu 16.04, NVIDIA Corporation GF119 [NVS 310].

There is also a similar Steam problem at: Steam won't start on Ubuntu 16.04

The problem is reproducible with a minimal GLUT hello world:

#include <stdlib.h>

#include <GL/glut.h>

int main(int argc, char *argv[]) {
    glutInit(&argc, argv);
    glutInitWindowSize(800, 600);
    glutInitWindowPosition(200, 100);
    glutCreateWindow(argv[0]);
    glutMainLoop();
    return EXIT_SUCCESS;
}

Ubuntu 19.04: the problem does not happen anymore

Haven't had this for a while, just upgrade Ubuntu if you can. Currently on 390.116 working perfectly.

Needed some minor BIOS option changes to get it started on my Lenovo ThinkPad P51: Ubuntu 17.10 boot stuck at message "Started NVIDIA Persistence Daemon" after installing nVidia 384.90

1
  • This worked perfectly for me (Ubuntu 20.04) -- I was using Nouveau, switched to a proprietary driver, and it resolved.
    – Jack
    Jul 27, 2021 at 22:31
2

Another situation where this error can arise is when you are trying to run OpenGL windows while running in a chroot environment. This post has a suggestion to add +iglx in the xserver-command for lightdm, which solved the problem for me. Putting this answere here for visibility as the other answer did not show up prominently on google.

1

Very simple, "non-invasive" solution.

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.

0

I had the same error message but it was caused by glutInitContextVersion(4, 0); because my hardware didn't support OpenGL 4.0 I changed the call to glutInitContextVersion(3, 3); and things became fine. I am using a proprietary NVidia driver.

3
0

WARNING:

I first tried the top solution posted by hangkongwang. Running the commands

sudo apt-get install --reinstall xserver-xorg-video-intel libgl1-mesa-glx libgl1-mesa-dri xserver-xorg-core 
sudo dpkg-reconfigure xserver-xorg

un-installed or otherwise broke some component of xserver or xorg (I'm not sure exactly which). So that upon rebooting my computer, I was presented with my background image and taskbar as usual, but with the computer completely frozen, accepting no input whatsoever from my mouse or keyboard.

So to solve this problem AND solve the original problem posed by hangkongwang, I had to boot my computer in Recover Mode (see the answer titled "Boot into recovery mode" in this StackExchange thread for instructions on how to do that). And then I had to re-install all of the xserver/xorg drivers with:

sudo apt-get install xserver-xorg-input-all

After running this command in recovery mode, and rebooting, I had access to my computer again, and could run glxinfo without any problems.

I'm unsure if it was hangkongwang's commands or mine that actually solved the glxinfo error. But I would advise future readers to try my solution first (maybe with --reinstall). If that doesn't work, at least copy the recovery instructions I've linked to above, and the xserver-xorg-input-all install command somewhere safe before attempting the top solution, just in case it also bricks your computer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.