0

I am trying to compile OpenGL code on a machine with NVidia 4.18 graphics driver and CUDA 10.1 installed. It is currently not linking with OpenGL like -lGL on the command line.

I recently set up my Ubuntu 18.04 LTS machine with CUDA 10.1 from the local runfile installer. I said to install everything in the installer. I can see by nvidia-smi that the 1050Ti is detected properly without problems. My issue is that I cannot run OpenGL programs. Some programs (not made by me) compile, but then throw this error when I try to run them:

Unable to create OpenGL context.

This leads me to think that OpenGL is not installed properly. I then checked to see what OpenGL version I am running right now. I checked the version with the command:

glxinfo | grep "OpenGL version"

On my machine that is NOT working, I get this output:

OpenGL version string: 3.0 Mesa 19.0.8

On a separate machine that DOES work, I get this output from the same glxinfo command:

OpenGL version string: 4.6.0 NVIDIA 410.48

(notice I am using a different driver than on my broken machine. That should not matter since both are using CUDA 10.X, at least, that is my understanding)

So, I see that I need to switch from Mesa to NVidia OpenGL loaders.

So, seeing this information,

  • How do I switch to the correct OpenGL loader?

I have consulted many links before creating this question.

tkazik
  • 245

1 Answers1

0

I had the same problem while using Nvidia GT 630.

Applications like Any desk which depends on OpenGL will not work properly on Nvidia drivers.

inxi output

Based on this question in Ask Ubuntu, it is needed to remove Nvidia and switch back to default Nouveau driver to get it fixed.

Lorenz Keel
  • 8,905