lspci 查看显卡
lspci
官方推荐
https://ubuntu.com/server/docs/nvidia-drivers-installation
ubuntu-drivers
Install the metapackage for your kernel flavour (e.g. generic, lowlatency, etc) which is specific to the driver branch (e.g. 535) that you want to install, and whether you want the compute vs. general display driver (e.g. -server or not):
- compute: 只有计算,-server
- general: 常规显示驱动
人工安装
- Installing the kernel modules
两种互斥的方法
Installing the pre-compiled NVIDIA modules for your kernel
sudo apt install linux-modules-nvidia-${DRIVER_BRANCH}${SERVER}-${LINUX_FLAVOUR}
sudo apt install linux-modules-nvidia-${DRIVER_BRANCH}${SERVER}-$(uname -r)
(e.g. sudo apt install linux-modules-nvidia-535-$(uname -r))
Building your own kernel modules using the NVIDIA DKMS package
If the headers for your current running kernel were not installed, install them by specifying the running kernel version:
sudo apt install linux-headers-$(uname -r)
Finally, install the NVIDIA DKMS package for your desired driver series (this may automatically guide you through creating and enrolling a new key for Secure Boot):
sudo apt install nvidia-dkms-${DRIVER_BRANCH}${SERVER}
- Installing the user-space drivers and the driver libraries
sudo apt install nvidia-driver-${DRIVER_BRANCH}${SERVER}
GL 相关的库
- OpenGL 是用于渲染2D、3D矢量图形的跨语言、跨平台的应用程序编程接口(API)。
- libglu1-mesa-dev
- freeglut3-dev 是基本OpenGL的扩展库。
- libgl1-mesa-glx 用于 X System 的扩展.
不同版本 libgl1-mesa-glx lts utopic
中 lts 代表 Long Time Support,utopic 是 Ubuntu 发行版的命名,更多发行版命名参见Releases.
apt install libgl1-mesa-dri-lts-vivid:i386
用于安装 32 位版本.
ppa 查看 build 包信息
apt list --installed | grep libgx1-mesa-glx
>> libgl1-mesa-glx/now 10.6.0~git20150528+10.6.ffd133bd-0ubuntu0ricotz~trusty amd64 [installed,local]
apt-cache policy libgl1-mesa-glx libgl1-mesa-glx:i386
可以查看到软件的软件的版本信息, 搜索可以得到具体 build 内容. xorg-edgers buld
glxinfo 查看详细信息
sudo apt-get install mesa-utils
To Check OpenGL Version,
glxinfo | grep "OpenGL version"
>> OpenGL version string: 1.4 (2.1 Mesa 7.7.1)