ubuntu16.04 从源码编译intel核显最新驱动

一、升级Linux内核

1、以v4.16.18为例子,依次下载

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.16.18/linux-headers-4.16.18-041618_4.16.18-041618.201806252030_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.16.18/linux-headers-4.16.18-041618-generic_4.16.18-041618.201806252030_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.16.18/linux-image-unsigned-4.16.18-041618-generic_4.16.18-041618.201806252030_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.16.18/linux-modules-4.16.18-041618-generic_4.16.18-041618.201806252030_amd64.deb

2、上述下载文件有依赖关系,因此按下载顺序来安装,依次执行

sudo dpkg -i linux*

3、重启系统

sudo reboot

二、依赖安装

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install x11proto-dri2-dev build-essential x11-common xutils-dev \
            flex bison xcb libx11-xcb-dev libxcb-glx0 \
            libxcb-glx0-dev xorg-dev libxcb-xfixes0-dev zlib1g \
            zlib1g-dev x11proto-gl-dev libpciaccess-dev libdri2-dev \
            libxcb-dri2-0-dev pkg-config libpixman-1-dev libx11-dev x11proto-gl-dev \
            libglib2.0-dev libgl1-mesa-dev x11proto-xf86dri-dev libgcrypt11-dev x11proto-xcmisc-dev \
            x11proto-bigreqs-dev x11proto-randr-dev x11proto-render-dev x11proto-fonts-dev libepoxy-dev \
            libkmod2 libkmod-dev libunwind8-dev \
            libudev-dev libevdev-dev libmtdev-dev autoconf automake libtool python-dev python-mako

三、显卡驱动编译

环境变量设置

Ubuntu 64 bits:

  export MY_DISTRO_PREFIX=/usr
  export MY_DISTRO_LIBDIR=/usr/lib/x86_64-linux-gnu

1、编译xserver

git clone git://git.freedesktop.org/git/xorg/xserver
./autogen.sh --prefix=$MY_DISTRO_PREFIX
make && sudo make install

2、编译libdrm

git clone git://anongit.freedesktop.org/mesa/drm
./autogen.sh --prefix=$MY_DISTRO_PREFIX --libdir=$MY_DISTRO_LIBDIR
make && sudo make install

3、编译mesa

git clone git://anongit.freedesktop.org/mesa/mesa
./autogen.sh --prefix=$MY_DISTRO_PREFIX --libdir=$MY_DISTRO_LIBDIR --with-dri-drivers="i915 i965" --with-dri-driverdir=$MY_DISTRO_PREFIX/lib/dri --enable-gles1--enable-gles2  --enable-shared-glapi  --with-gallium-drivers= --with-egl-platforms=x11,drm --enable-texture-float --enable-gbm --enable-glx-tls --enble-dri3
make && sudo make install

4、编译xf86-video-intel

git clone git://anongit.freedesktop.org/xorg/driver/xf86-video-intel
./autogen.sh --prefix=$MY_DISTRO_PREFIX --libdir=$MY_DISTRO_LIBDIR
make && sudo make install

5、编译libbva

git clone git://git.freedesktop.org/git/vaapi/libva
./autogen.sh --prefix=$MY_DISTRO_PREFIX 
make && sudo make install

6、编译vappi driver

git clone git://git.freedesktop.org/git/vaapi/intel-driver
./autogen.sh --prefix=$MY_DISTRO_PREFIX 
make && sudo make install

7、编译 cairo

git clone git://git.freedesktop.org/git/cairo
./autogen.sh --prefix=$MY_DISTRO_PREFIX 
make && sudo make install

8、编译intel-gpu-tools

git clone git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
./autogen.sh --prefix=$MY_DISTRO_PREFIX --libdir=$MY_DISTRO_LIBDIR --disable-amdgpu
make && sudo make install

9、重启系统

sudo reboot

重启系统后有可能出现鼠标键盘不能用的情况,请按以下步骤安装鼠标键盘驱动

1、下载驱动 xf86-input-evdev(大部分插拔设备的驱动) xf86-input-mouse xf86-input-keyboard
wget https://www.x.org/archive/individual/driver/xf86-input-evdev-2.10.0.tar.gz
wget https://www.x.org/archive/individual/driver/xf86-input-mouse-1.9.2.tar.gz
wget https://www.x.org/archive/individual/driver/xf86-input-keyboard-1.9.0.tar.gz

tar xvf xf86-input-evdev-2.10.0.tar.gz
tar xvf xf86-input-mouse-1.9.2.tar.gz
tar xvf xf86-input-keyboard-1.9.0.tar.gz

2、evdev编译

cd xf86-input-evdev-2.10.0
./configure --prefix=/usr
make&&sudo make install

3、鼠标驱动编译

cd xf86-input-mouse-1.9.2
./configure --prefix=/usr
make && sudo make install

4、键盘驱动编译

cd xf86-input-keyboard-1.9.0
./configure --prefix=/usr
make && sudo make install

5、重启电脑

sudo ldconfig
sudo reboot

完成。

你可能感兴趣的:(ubuntu16.04 从源码编译intel核显最新驱动)