Compile NVIDIA driver on Lenovo W520 with Debian

來源:互聯網
上載者:User

標籤:des   style   strong   os   cti   linux   

Originally, I installed an Ubuntu using Wubi on my company‘s laptop (Lenovo W520). One purpose is for fun, the other is to use some instant messengers, which are blocked by default on our Windows system. Now, having come to Switzerland, Skype is no doubt the best tool for international communication, which can only be installed on Linux system however.

In order to have better system performance, I decided to change Wubi to Debian. Actually speaking, Debian has much worse user experience than Ubuntu. For example, it does not support NVIDIA graphic display by default. Therefore, I had to download the NVIDIA driver and compiled it into the Linux kernel. The following things must be prepared beforehand:

  1. Check Linux kernel version and the gcc version which compiled this kernel

    cat /proc/version

    Linux version 2.6.32-5-amd64 (Debian 2.6.32-46) ([email protected]) (gcc version 4.3.5 (Debian 4.3.5-4) ) #1 SMP Sun Sep 23 10:07:46 UTC 2012

    My Linux kernel version is: 2.6.32-5-amd64 (Debian 2.6.32-46) (the corresponding package is linux-image-2.6.32-5-amd64 with a detailed version number 2.6.32-46). The version of gcc compiling this kernel is: 4.3.5 (Debian 4.3.5-4)

  2. Install the gcc compiler with the above version 4.3.5 (Debian 4.3.5-4)

    Usually, there may be a gcc compiler with a higher version than the one that compiled the kernel. For example, on my system, the default gcc version is 4.4.5 (Debian 4.4.5-8), which is higher than the kernel compiler 4.3.5 (Debian 4.3.5-4). Then, we should create a symbolic link gcc in /usr/bin to the compiler we want:

    ln -sf /usr/bin/gcc-4.3 /usr/bin/gcc

  3. Install corresponding linux-source package

    For me, it is linux-source-2.6.32 with a detailed version number 2.6.32-46. The NVIDIA driver will be compiled through a kernel interface, which is special layer between the Linux kernel and the NVIDIA driver. This compilation requires this linux-source package installed.

  4. NVIDIA kernel module

    I‘ve also installed the package nvidia-kernel-195.36.31, which provides the non-free NVIDIA kernel module. With this installed, the video display is still not correct. Therefore, I‘m not sure what is its actual function. But for safety, just keep this package.

  5. Download NVIDIA driver from its official website. The file for me is NVIDIA-Linux-x86_64-304.64.run.

With everything at hand, just run NVIDIA-Linux-x86_64-304.64.run to compile and install the NVIDIA kernel module. After that, run nvidia-xconfig to generate a xorg.conf file.

One more thing to be paid attention to is the BIOS option for graphics card. Instead of using OS detection for NVIDIA Optimus, we should use Discrete Graphics.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.