From 3fe3bc533ad5c9e2d4a746272f15e23795e5c215 Mon Sep 17 00:00:00 2001 From: puneetse <22071208+puneetse@users.noreply.github.com> Date: Wed, 20 Mar 2019 16:32:10 +0000 Subject: [PATCH] Add document on installing proprietary NVIDIA drivers (#429) --- .../maintenance/kernel-modules-dkms.rst | 5 +- source/clear-linux/tutorials/nvidia.rst | 180 ++++++++++++++++++ source/clear-linux/tutorials/tutorials.rst | 1 + 3 files changed, 185 insertions(+), 1 deletion(-) create mode 100644 source/clear-linux/tutorials/nvidia.rst diff --git a/source/clear-linux/guides/maintenance/kernel-modules-dkms.rst b/source/clear-linux/guides/maintenance/kernel-modules-dkms.rst index b3ba1066..a9718b94 100644 --- a/source/clear-linux/guides/maintenance/kernel-modules-dkms.rst +++ b/source/clear-linux/guides/maintenance/kernel-modules-dkms.rst @@ -37,7 +37,9 @@ hooks that automatically rebuild modules against new kernel versions. Install DKMS on |CL| ==================== -The *kernel-native-dkms* bundle provides the :command:`dkms`: program and +.. _kernel-modules-dkms-install-begin: + +The *kernel-native-dkms* bundle provides the :command:`dkms` program and Linux kernel headers, which are required for compiling kernel modules. The *kernel-native-dkms* bundle also: @@ -98,6 +100,7 @@ Install the *kernel-native-dkms* or *kernel-lts-dkms* bundle: reboot +.. _kernel-modules-dkms-install-end: Build, install, and load an out-of-tree module ============================================== diff --git a/source/clear-linux/tutorials/nvidia.rst b/source/clear-linux/tutorials/nvidia.rst new file mode 100644 index 00000000..0f3850f7 --- /dev/null +++ b/source/clear-linux/tutorials/nvidia.rst @@ -0,0 +1,180 @@ +.. _nvidia: + +Install NVIDIA Drivers +###################### + +NVIDIA is a manufacture of graphics processing units (GPU), also known as +graphics cards. + +NVIDIA devices on Linux have two popular device driver options: the opensource +drivers from the `nouveau project`_ or the proprietary drivers published by +NVIDIA. The nouveau drivers are built into the |CL-ATTR| kernel and are loaded +automatically at system boot if a compatible card is detected. + +These instructions show how to use the proprietary NVIDIA drivers which +require a manual installation. + + +.. contents:: :local: + :depth: 2 + + + +Prerequisites +************* + +* A |CL| system with a desktop installed +* A NVIDIA device installed + + +Install the LTS kernel and DKMS +******************************* + +The Long Term Support (LTS) kernel variant is most likely to remain +compatible with NVIDIA drivers. The `Dynamic Kernel Module System (DKMS) +`_ allows the NVIDIA kernel modules to be automatically +integrated when kernel updates occur in |CL|. Install both using the +instructions below: + + +.. include:: ../guides/maintenance/kernel-modules-dkms.rst + :start-after: kernel-modules-dkms-install-begin: + :end-before: kernel-modules-dkms-install-end: + + +Download and install the NVIDIA Linux Driver +******************************************** + + +Download the NVIDIA Linux Driver +================================ + +#. Identify the model of NVIDIA GPU that is installed. + + .. code-block:: bash + + lshw -C display + + +#. Go to the `NVIDIA Driver Downloads website`_ . Search for and download the + appropriate driver based on the model of NVIDIA GPU you have with *Linux + 64-bit* selected as the Operating System . + + +#. Open a terminal and navigate to where the + :file:`NVIDIA-Linux-x86_64-.run` file was saved. In this + example, it was saved in the Downloads folder. + + .. code-block:: bash + + cd ~/Downloads/ + + +#. Extract the contents of the .run file. + + .. code-block:: bash + + sh NVIDIA-Linux-x86_64-.run --extract-only + + +Disable the nouveau driver +========================== + +#. The proprietary NVIDIA driver is incompatible with the nouveau driver and + needs to be disabled before installation can continue. + + Disable the nouveau driver by creating a file under :file:`/etc/modprobe.d` + and reboot. + + .. code-block:: bash + + sudo mkdir /etc/modprobe.d + + echo "blacklist nouveau" | sudo tee --append /etc/modprobe.d/nvidia-disable-nouveau.conf + echo "options nouveau modeset=0" | sudo tee --append /etc/modprobe.d/nvidia-disable-nouveau.conf + + +#. Reboot the system and log back in. It is normal for the graphical + environment to not start with no NVIDIA driver loaded. + + +Install the NVIDIA Linux Driver +=============================== + +#. Navigate into the directory where the NVIDIA installer was extracted. + + .. code-block:: bash + + cd ~/Downloads/NVIDIA-Linux-x86_64-/ + + +#. Run the installer with the advanced options below. + + .. code-block:: bash + + sudo ./nvidia-installer --no-nvidia-modprobe --no-distro-scripts --no-opengl-files --no-libglx-indirect --no-install-libglvnd --no-install-compat32-libs --dkms --ui=none + +#. The installer will prompt to register the kernel module sources with + DKMS. Enter Y for yes. + + .. code-block:: bash + + Welcome to the NVIDIA Software Installer for Unix/Linux + + + + Would you like to register the kernel module sources with DKMS? This will allow DKMS to automatically build a new + module, if you install a different kernel later. + [default: (Y)es]: Y + + + +#. The graphical interface may automatically start after the NVIDIA driver + is loaded. If it does restart, log back in. + + +#. Validate the nvidia kernel modules are loaded. + + .. code-block:: bash + + lsmod | grep ^nvidia + + +.. note:: + + The NVIDIA installer places files under the :file:`/usr` subdirectory which + are not managed by |CL| updates. The :command:`swupd verify --fix` command + should be avoided with the proprietary NVIDIA drivers in use. + + +Uninstalling the NVIDIA driver +****************************** + +The NVIDIA drivers and associated software can be uninstalled and nouveau +driver restored by: + +#. Remove the previously created file :file:`etc/modprobe.d` that is + preventing nouveau from loading. + + .. code-block:: bash + + sudo rm /etc/modprobe.d/nvidia-disable-nouveau.conf + + +#. Run the :command:`sudo nvidia-uninstall` + +#. Follow the prompts on the screen and reboot the system. + + + +Additional resources +******************** + +* `Why aren't the NVIDIA Linux drivers open source? `_ + +* `Where can I get support for NVIDIA Linux drivers? `_ + + +.. _`nouveau project`: https://nouveau.freedesktop.org/wiki/ + +.. _`NVIDIA Driver Downloads website`: https://www.nvidia.com/download/index.aspx diff --git a/source/clear-linux/tutorials/tutorials.rst b/source/clear-linux/tutorials/tutorials.rst index 0c8d777d..39393902 100644 --- a/source/clear-linux/tutorials/tutorials.rst +++ b/source/clear-linux/tutorials/tutorials.rst @@ -32,3 +32,4 @@ Explore our tutorials to discover what you can do with |CL|! kubernetes/kubernetes* greengrass dlrs + nvidia