The following procedure will install the open source display driver packages, DRI modules (for 3D acceleration) and driver firmware/microcode:
If you have previously used the non-free nvidia proprietary driver, then you need to uninstall it if you wish to use OpenGL accelerated graphics. The easiest way is to use the command:
# apt-get purge nvidia.
Don't forget the "." dot after nvidia - This erases every package with "nvidia" in its name.
Add "contrib" and "non-free" components to /etc/apt/sources.list, for example:
# Debian 8 "Jessie"
deb http://httpredir.debian.org/debian/ jessie main contrib non-free