How to install nvidia drivers on Ubuntu 16.04

To check how many frames per second reach your graphic card, you can run glxgears:

sudo apt-get install mesa-utils
glxgears

2854 frames in 5.0 seconds = 570.636 FPS
2800 frames in 5.0 seconds = 559.996 FPS
2828 frames in 5.0 seconds = 565.470 FPS
2875 frames in 5.0 seconds = 574.286 FPS
2903 frames in 5.0 seconds = 579.824 FPS



To show wich driver is using it, put the following sentence on your terminal:

glxinfo | grep OpenGL

OpenGL vendor string: VMware, Inc.
OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.8, 256 bits)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 11.2.0
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 11.2.0
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 11.2.0
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
OpenGL ES profile extensions:

Now, we going to install nvidia drivers and restart our computer:

sudo apt-get install nvidia-367
sudo init 6

If you check the driver, you can see that nvidia was installed:

glxinfo | grep OpenGL

OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GTX 950/PCIe/SSE2
OpenGL core profile version string: 4.5.0 NVIDIA 367.57
OpenGL core profile shading language version string: 4.50 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.5.0 NVIDIA 367.57
OpenGL shading language version string: 4.50 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 367.57
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

But... as you can see, the FPS is lower than the default driver:

glxgears

Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.
301 frames in 5.0 seconds = 60.023 FPS
301 frames in 5.0 seconds = 60.003 FPS
300 frames in 5.0 seconds = 59.806 FPS
299 frames in 5.0 seconds = 59.797 FPS
300 frames in 5.0 seconds = 59.801 FPS
300 frames in 5.0 seconds = 59.999 FPS

To fix it, you need to disable VBLANK flag. You can do it on the fly like this:

__GL_SYNC_TO_VBLANK=0 glxgears
123638 frames in 5.0 seconds = 24727.447 FPS
126122 frames in 5.0 seconds = 25224.289 FPS

or, you can disable "Sync to VBlank"  from the Nvidia GUI:


Enjoy it!

Comments

Popular posts from this blog

Exception: Could not find a default OpenFlow controller in Mininet

How to fix Android when developer options are not available for this user

Webcam streaming throught VLC with YUY2 compatibility