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.
- How do I get OpenGL working on an Nvidia GeForce GT 750M?
- https://www.reddit.com/r/linuxquestions/comments/bbc1kx/ubuntu_1804_nvidia_driver_wont_load
- Opengl Mesa : use opengl 4.0
- How to emulate/replace OpenGL version?
- How to check the information of current installed video drivers?
- How can I find what video driver is in use on my system?
- What is terminal command that can show OpenGL version?