Files
clear-linux-documentation/tutorials/nvidia.html
2024-11-04 18:56:31 +00:00

661 lines
41 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="en" data-content_root="../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>NVIDIA* Drivers &#8212; Documentation for Clear Linux* project</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/bizstyle.css?v=5283bb3d" />
<link rel="stylesheet" type="text/css" href="../_static/copybutton.css?v=76b2166b" />
<script src="../_static/documentation_options.js?v=5929fcd5"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/clipboard.min.js?v=a7894cd8"></script>
<script src="../_static/copybutton.js?v=a56c686a"></script>
<script src="../_static/bizstyle.js"></script>
<link rel="canonical" href="https://clearlinux.github.io/clear-linux-documentation/tutorials/nvidia.html" />
<link rel="icon" href="../_static/favicon.ico"/>
<link rel="author" title="About these documents" href="../about.html" />
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="NVIDIA* CUDA Toolkit" href="nvidia-cuda.html" />
<link rel="prev" title="Mirror Upstream Clear Linux OS Update Server" href="mirror-upstream-server.html" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<!--[if lt IE 9]>
<script src="_static/css3-mediaqueries.js"></script>
<![endif]-->
</head><body>
<div class="related" role="navigation" aria-label="Related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="nvidia-cuda.html" title="NVIDIA* CUDA Toolkit"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="mirror-upstream-server.html" title="Mirror Upstream Clear Linux OS Update Server"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Documentation for Clear Linux* project</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Tutorials</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">NVIDIA* Drivers</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="nvidia-drivers">
<span id="nvidia"></span><h1>NVIDIA* Drivers<a class="headerlink" href="#nvidia-drivers" title="Link to this heading"></a></h1>
<p>NVIDIA manufactures graphics processing units (GPU), also known as
graphics cards.</p>
<p>NVIDIA devices on Linux* have two popular device driver options: the
opensource drivers from the <a class="reference external" href="https://nouveau.freedesktop.org/wiki/">nouveau project</a> or the proprietary drivers
published by NVIDIA. The nouveau drivers are built into the Clear Linux* OS
kernel and are loaded automatically at system boot if a compatible card
is detected.</p>
<p>These instructions show how to use the proprietary NVIDIA drivers, which
require a manual installation.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>Software installed outside of <a class="reference internal" href="../guides/clear/swupd.html#swupd-guide"><span class="std std-ref">swupd</span></a> is not updated
with Clear Linux OS updates and must be updated and maintained manually.</p>
<p>For example, the file <code class="file docutils literal notranslate"><span class="pre">/usr/lib/libGL.so</span></code> conflicts with the file
provided by the mesa package in Clear Linux OS and the file NVIDIA provides. If a
Clear Linux OS update or repair overwrites these files, a reinstallation of the
NVIDIA driver might be required.</p>
</div>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#prerequisites" id="id2">Prerequisites</a></p></li>
<li><p><a class="reference internal" href="#installation" id="id3">Installation</a></p></li>
<li><p><a class="reference internal" href="#updating" id="id4">Updating</a></p></li>
<li><p><a class="reference internal" href="#uninstallation" id="id5">Uninstallation</a></p></li>
<li><p><a class="reference internal" href="#troubleshooting" id="id6">Troubleshooting</a></p></li>
</ul>
</nav>
<section id="prerequisites">
<h2><a class="toc-backref" href="#id2" role="doc-backlink">Prerequisites</a><a class="headerlink" href="#prerequisites" title="Link to this heading"></a></h2>
<ul class="simple">
<li><p>A Clear Linux OS system with a desktop installed</p></li>
<li><p>An NVIDIA device installed</p></li>
</ul>
<section id="known-issues">
<h3>Known issues<a class="headerlink" href="#known-issues" title="Link to this heading"></a></h3>
<p>Systems with multiple graphics devices, including integrated graphics (iGPU),
are known to be problematic.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>NVIDIA Optimus*</p>
<p>Some systems come with a hybrid graphics configuration for a balanced power
and performance profile. This configuration is commonly found on
laptops. <a class="reference external" href="https://www.geforce.com/hardware/technology/optimus">NVIDIA Optimus technology</a>, is designed to
allow switching seamlessly between a NVIDIA device and another graphics
devices sharing the same display.</p>
<p>Getting NVIDIA Optimus on Linux working well with both graphics devices
adds an additional level of complexity with platform specific steps and may
require additional software. Installation for systems with NVIDIA Optimus
with both graphics devices operating is not covered by the scope of this
documentation. As a simple workaround, some systems can disable one of the
graphics devices or NVIDIA Optimus in the system firmware.</p>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The <a class="reference internal" href="../guides/clear/compatible-kernels.html#compatible-kernels"><span class="std std-ref">Long Term Support (LTS) kernel</span></a> variant is
more likely to be compatible with proprietary NVIDIA drivers.</p>
</div>
<p><strong>See the</strong> <a class="reference internal" href="#troubleshooting">Troubleshooting</a> <strong>section for more known issues and solutions.</strong></p>
</section>
</section>
<section id="installation">
<h2><a class="toc-backref" href="#id3" role="doc-backlink">Installation</a><a class="headerlink" href="#installation" title="Link to this heading"></a></h2>
<section id="configure-workarounds">
<h3>Configure workarounds<a class="headerlink" href="#configure-workarounds" title="Link to this heading"></a></h3>
<p>Some workarounds are required for the NVIDIA proprietary drivers to be usable
and sustainable on Clear Linux OS.</p>
<ol class="arabic">
<li><p>Remove the kernel command-line parameter <em>intel_iommu=igfx_off</em> or disable
inputoutput memory management unit (IOMMU), also known as Intel®
Virtualization Technology (Intel® VT) for Directed I/O (Intel® VT-d), in your system EFI/BIOS.
See <a class="reference external" href="https://github.com/clearlinux/distribution/issues/1274">this GitHub report</a> and the NVIDIA
documentation on <a class="reference external" href="https://download.nvidia.com/XFree86/Linux-x86_64/440.44/README/dma_issues.html">DMA issues</a>
for more information.</p>
<p>The <em>intel_iommu-igfx_off</em> kernel parameter can be removed with the
commands below:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>mkdir<span class="w"> </span>-p<span class="w"> </span>/etc/kernel/cmdline-removal.d/
<span class="nb">echo</span><span class="w"> </span><span class="s2">&quot;intel_iommu=igfx_off&quot;</span><span class="w"> </span><span class="p">|</span><span class="w"> </span>sudo<span class="w"> </span>tee<span class="w"> </span>/etc/kernel/cmdline-removal.d/intel-iommu.conf
</pre></div>
</div>
</li>
<li><p>Create a custom systemd unit that overwrites the <code class="file docutils literal notranslate"><span class="pre">libGL</span></code> library
after every Clear Linux OS update with a pointer to the NVIDIA provided copy instead
of the version provided by Clear Linux OS. These libraries conflict causing the
NVIDIA driver to break when Clear Linux OS updates mesa. See the NVIDIA documentation
on <a class="reference external" href="https://download.nvidia.com/XFree86/Linux-x86_64/440.44/README/installedcomponents.html">installed components</a>
for more information.</p>
<ol class="loweralpha">
<li><p>Create a systemd service unit to overwrite the Clear Linux OS provided
<code class="file docutils literal notranslate"><span class="pre">libGL.so.1</span></code> files with a symlink to the NVIDIA copies.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>tee<span class="w"> </span>/etc/systemd/system/fix-nvidia-libGL-trigger.service<span class="w"> </span>&gt;<span class="w"> </span>/dev/null<span class="w"> </span><span class="s">&lt;&lt;&#39;EOF&#39;</span>
<span class="s">[Unit]</span>
<span class="s">Description=Fixes libGL symlinks for the NVIDIA proprietary driver</span>
<span class="s">BindsTo=update-triggers.target</span>
<span class="s">[Service]</span>
<span class="s">Type=oneshot</span>
<span class="s">ExecStart=/usr/bin/ln -sfv /opt/nvidia/lib/libGL.so.1 /usr/lib/libGL.so.1</span>
<span class="s">ExecStart=/usr/bin/ln -sfv /opt/nvidia/lib32/libGL.so.1 /usr/lib32/libGL.so.1</span>
<span class="s">EOF</span>
</pre></div>
</div>
</li>
<li><p>Reload the systemd manager configuration to pickup the new serivce.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>systemctl<span class="w"> </span>daemon-reload
</pre></div>
</div>
</li>
<li><p>Add the service as a dependency to the Clear Linux OS updates trigger causing the
service to run after every update.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>systemctl<span class="w"> </span>add-wants<span class="w"> </span>update-triggers.target<span class="w"> </span>fix-nvidia-libGL-trigger.service
</pre></div>
</div>
</li>
</ol>
</li>
</ol>
</section>
<section id="install-dkms">
<h3>Install DKMS<a class="headerlink" href="#install-dkms" title="Link to this heading"></a></h3>
<p>The <a class="reference internal" href="../guides/kernel/kernel-modules-dkms.html#kernel-modules-dkms"><span class="std std-ref">Dynamic Kernel Module System (DKMS)</span></a> allows
the NVIDIA kernel modules to be automatically integrated when kernel updates
occur in Clear Linux OS. Install the appropriate DKMS bundle using the instructions
below:</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The Long Term Support (LTS) kernel variant is more likely to remain
compatible between updates with NVIDIA drivers.</p>
</div>
<p>The <strong class="command">kernel-native-dkms</strong> bundle provides the DKMS program and Linux
kernel headers, which are placed under <code class="file docutils literal notranslate"><span class="pre">/usr/lib/modules/$(uname</span>
<span class="pre">-r)/build/include/</span></code> and are required to compile kernel modules.</p>
<p>The <strong class="command">kernel-native-dkms</strong> bundle also:</p>
<ul class="simple">
<li><p>Adds a <cite>systemd</cite> update trigger
(<code class="file docutils literal notranslate"><span class="pre">/usr/lib/systemd/system/dkms-new-kernel.service</span></code>) to automatically
run DKMS to rebuild modules after a kernel upgrade occurs with <a class="reference internal" href="../guides/clear/swupd.html#swupd-guide"><span class="std std-ref">swupd
update</span></a>.</p></li>
<li><p>Disables kernel module signature verification by appending a kernel
command-line parameter (<strong class="command">module.sig_unenforce</strong>) from the
<code class="file docutils literal notranslate"><span class="pre">/usr/share/kernel/cmdline.d/clr-ignore-mod-sig.conf</span></code> file.</p></li>
<li><p>Adds a notification to the Message of the Day (MOTD) indicating kernel
module signature verification is disabled.</p></li>
</ul>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>We recommend that you always review the <strong class="command">swupd update</strong> output
to make sure kernel modules were successfully rebuilt against the new
kernel. This is especially important for systems where a successful boot
relies on a kernel module.</p>
</div>
<p id="kernel-modules-dkms-install-begin-alt">Install the <strong class="command">kernel-native-dkms</strong> or <strong class="command">kernel-lts-dkms</strong>
bundle.</p>
<ol class="arabic">
<li><p>Determine which kernel variant is running on Clear Linux OS. Only the <em>native</em>
and <em>lts</em> kernels are enabled to build and load out-of-tree kernel modules
with DKMS.</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>uname<span class="w"> </span>-r
<span class="go">5.XX.YY-ZZZZ.native</span>
</pre></div>
</div>
<p>Ensure <em>.native</em> or <em>.lts</em> is in the kernel name.</p>
</li>
<li><p>Install the DKMS bundle corresponding to the installed kernel. Use
<strong class="command">kernel-native-dkms</strong> for the native kernel or
<strong class="command">kernel-lts-dkms</strong> for the lts kernel.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>swupd<span class="w"> </span>bundle-add<span class="w"> </span>kernel-native-dkms
</pre></div>
</div>
<p>or</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>swupd<span class="w"> </span>bundle-add<span class="w"> </span>kernel-lts-dkms
</pre></div>
</div>
</li>
<li><p>Update the Clear Linux OS bootloader and reboot, and
ensure that you can start the new kernel.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>clr-boot-manager<span class="w"> </span>update
reboot
</pre></div>
</div>
</li>
</ol>
</section>
<section id="download-the-nvidia-drivers">
<h3>Download the NVIDIA drivers<a class="headerlink" href="#download-the-nvidia-drivers" title="Link to this heading"></a></h3>
<ol class="arabic">
<li><p>Identify the NVIDIA GPU model that is installed.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>lshw<span class="w"> </span>-C<span class="w"> </span>display
</pre></div>
</div>
</li>
<li><p>Go to the <a class="reference external" href="https://www.nvidia.com/download/index.aspx">NVIDIA Driver Downloads website</a> . Search for and download the
appropriate driver based on the NVIDIA GPU model you have with <em>Linux
64-bit</em> selected as the Operating System.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>wget<span class="w"> </span>https://download.nvidia.com/XFree86/Linux-x86_64/&lt;VERSION&gt;/NVIDIA-Linux-x86_64-&lt;VERSION&gt;.run
</pre></div>
</div>
<p>If you already know the appropriate driver version for your device, you can
also obtain a download link directly from one of the links below:</p>
<ul class="simple">
<li><p><a class="reference external" href="https://www.nvidia.com/en-us/drivers/unix/">https://www.nvidia.com/en-us/drivers/unix/</a></p></li>
<li><p><a class="reference external" href="https://download.nvidia.com/XFree86/Linux-x86_64/">https://download.nvidia.com/XFree86/Linux-x86_64/</a></p></li>
</ul>
</li>
</ol>
</section>
<section id="disable-the-nouveau-driver">
<h3>Disable the nouveau driver<a class="headerlink" href="#disable-the-nouveau-driver" title="Link to this heading"></a></h3>
<p>The proprietary NVIDIA driver is incompatible with the nouveau driver and
must be disabled before installation can continue.</p>
<ol class="arabic">
<li><p>Disable the nouveau driver by creating a blacklist file under
<code class="file docutils literal notranslate"><span class="pre">/etc/modprobe.d</span></code> and reboot.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>mkdir<span class="w"> </span>/etc/modprobe.d
<span class="nb">printf</span><span class="w"> </span><span class="s2">&quot;blacklist nouveau \noptions nouveau modeset=0 \n&quot;</span><span class="w"> </span><span class="p">|</span><span class="w"> </span>sudo<span class="w"> </span>tee<span class="w"> </span>--append<span class="w"> </span>/etc/modprobe.d/disable-nouveau.conf
</pre></div>
</div>
</li>
<li><p>Reboot the system and log back in. It is normal for the graphical
environment not to start without the NVIDIA driver loaded.</p></li>
</ol>
</section>
<section id="configure-alternative-software-paths">
<h3>Configure alternative software paths<a class="headerlink" href="#configure-alternative-software-paths" title="Link to this heading"></a></h3>
<p>The NVIDIA installer is directed to install files under
<code class="file docutils literal notranslate"><span class="pre">/opt/nvidia</span></code> as much as possible to keep its contents isolated from the
rest of the Clear Linux OS system files under <code class="file docutils literal notranslate"><span class="pre">/usr</span></code>. The dynamic linker and X
server must be configured to use the content under
<code class="file docutils literal notranslate"><span class="pre">/opt/nvidia</span></code>.</p>
<ol class="arabic">
<li><p>Configure the dynamic linker to look for and to cache shared libraries under
<code class="file docutils literal notranslate"><span class="pre">/opt/nvidia/lib</span></code> and <code class="file docutils literal notranslate"><span class="pre">/opt/nvidia/lib32</span></code> in addition to the
default paths.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">echo</span><span class="w"> </span><span class="s2">&quot;include /etc/ld.so.conf.d/*.conf&quot;</span><span class="w"> </span><span class="p">|</span><span class="w"> </span>sudo<span class="w"> </span>tee<span class="w"> </span>--append<span class="w"> </span>/etc/ld.so.conf
sudo<span class="w"> </span>mkdir<span class="w"> </span>/etc/ld.so.conf.d
<span class="nb">printf</span><span class="w"> </span><span class="s2">&quot;/opt/nvidia/lib \n/opt/nvidia/lib32 \n&quot;</span><span class="w"> </span><span class="p">|</span><span class="w"> </span>sudo<span class="w"> </span>tee<span class="w"> </span>--append<span class="w"> </span>/etc/ld.so.conf.d/nvidia.conf
</pre></div>
</div>
</li>
<li><p>Reload the dynamic linker run-time bindings and library cache.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>ldconfig
</pre></div>
</div>
</li>
<li><p>Create a Xorg configuration file to search for modules under
<code class="file docutils literal notranslate"><span class="pre">/opt/nvidia</span></code> in addition to the default path.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>mkdir<span class="w"> </span>-p<span class="w"> </span>/etc/X11/xorg.conf.d/
sudo<span class="w"> </span>tee<span class="w"> </span>/etc/X11/xorg.conf.d/nvidia-files-opt.conf<span class="w"> </span>&gt;<span class="w"> </span>/dev/null<span class="w"> </span><span class="s">&lt;&lt;&#39;EOF&#39;</span>
<span class="s">Section &quot;Files&quot;</span>
<span class="s"> ModulePath &quot;/usr/lib64/xorg/modules&quot;</span>
<span class="s"> ModulePath &quot;/opt/nvidia/lib64/xorg/modules&quot;</span>
<span class="s">EndSection</span>
<span class="s">EOF</span>
</pre></div>
</div>
</li>
</ol>
</section>
<section id="install-the-nvidia-drivers">
<h3>Install the NVIDIA drivers<a class="headerlink" href="#install-the-nvidia-drivers" title="Link to this heading"></a></h3>
<ol class="arabic">
<li><p>A terminal not running on <em>/dev/tty1</em> is useful to view uninterrupted
installation progress. Switch to a secondary virtual terminal by pushing
<strong class="command">CTRL + ALT + F2</strong> or remotely login over SSH.</p></li>
<li><p>Navigate to the directory where the NVIDIA installer was downloaded. In
this example, it was saved in the <code class="file docutils literal notranslate"><span class="pre">Downloads</span></code> folder.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">cd</span><span class="w"> </span>~/Downloads/
</pre></div>
</div>
</li>
<li><p>Run the installer with the advanced options below.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>sh<span class="w"> </span>NVIDIA-Linux-x86_64-&lt;VERSION&gt;.run<span class="w"> </span><span class="se">\</span>
--utility-prefix<span class="o">=</span>/opt/nvidia<span class="w"> </span><span class="se">\</span>
--opengl-prefix<span class="o">=</span>/opt/nvidia<span class="w"> </span><span class="se">\</span>
--compat32-prefix<span class="o">=</span>/opt/nvidia<span class="w"> </span><span class="se">\</span>
--compat32-libdir<span class="o">=</span>lib32<span class="w"> </span><span class="se">\</span>
--x-prefix<span class="o">=</span>/opt/nvidia<span class="w"> </span><span class="se">\</span>
--x-module-path<span class="o">=</span>/opt/nvidia/lib64/xorg/modules<span class="w"> </span><span class="se">\</span>
--x-library-path<span class="o">=</span>/opt/nvidia/lib64<span class="w"> </span><span class="se">\</span>
--x-sysconfig-path<span class="o">=</span>/etc/X11/xorg.conf.d<span class="w"> </span><span class="se">\</span>
--documentation-prefix<span class="o">=</span>/opt/nvidia<span class="w"> </span><span class="se">\</span>
--application-profile-path<span class="o">=</span>/etc/nvidia/nvidia-application-profiles-rc.d<span class="w"> </span><span class="se">\</span>
--no-precompiled-interface<span class="w"> </span><span class="se">\</span>
--no-nvidia-modprobe<span class="w"> </span><span class="se">\</span>
--no-distro-scripts<span class="w"> </span><span class="se">\</span>
--force-libglx-indirect<span class="w"> </span><span class="se">\</span>
--glvnd-egl-config-path<span class="o">=</span>/etc/glvnd/egl_vendor.d<span class="w"> </span><span class="se">\</span>
--egl-external-platform-config-path<span class="o">=</span>/etc/egl/egl_external_platform.d<span class="w"> </span><span class="se">\</span>
--dkms<span class="w"> </span><span class="se">\</span>
--silent
</pre></div>
</div>
</li>
<li><p>The graphical interface may automatically start after the NVIDIA driver
is loaded. Return to the working terminal and log back in if necessary.</p></li>
<li><p>Confirm that the NVIDIA kernel modules are loaded.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>lsmod<span class="w"> </span><span class="p">|</span><span class="w"> </span>grep<span class="w"> </span>^nvidia
</pre></div>
</div>
</li>
<li><p>Optional: Create a link for the nvidia-settings desktop entry to
<code class="file docutils literal notranslate"><span class="pre">~/.local/share/applications</span></code> so that it appears in the launcher for easy access.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>ln<span class="w"> </span>-sv<span class="w"> </span>/opt/nvidia/share/applications/nvidia-settings.desktop<span class="w"> </span><span class="nv">$HOME</span>/.local/share/applications
</pre></div>
</div>
</li>
</ol>
</section>
</section>
<section id="updating">
<h2><a class="toc-backref" href="#id4" role="doc-backlink">Updating</a><a class="headerlink" href="#updating" title="Link to this heading"></a></h2>
<p>The proprietary NVIDIA drivers are installed manually outside of
<a class="reference internal" href="../guides/clear/swupd.html#swupd-guide"><span class="std std-ref">swupd</span></a> and must be updated manually when needed.</p>
<p>Updating the NVIDIA drivers follows the same steps as initial installation,
however the desktop environment must first be stopped so that the drivers are
not in use.</p>
<ol class="arabic">
<li><p>Follow the steps in the <a class="reference internal" href="#download-the-nvidia-drivers">Download the NVIDIA drivers</a> section
to get the latest NVIDIA drivers.</p></li>
<li><p>Temporarily set the default boot target to the <em>multi-user</em>, which is
a non-graphical runtime.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>systemctl<span class="w"> </span>set-default<span class="w"> </span>multi-user.target
</pre></div>
</div>
</li>
<li><p>Reboot the system and log back in. It is normal for the graphical
environment not to start.</p></li>
<li><p>Follow the steps in the <a class="reference internal" href="#install-the-nvidia-drivers">Install the NVIDIA Drivers</a> section to update
the NVIDIA drivers. This installation will overwrite the previous NVIDIA
drivers and files.</p></li>
<li><p>Set the default boot target back to the <em>graphical</em> target.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>systemctl<span class="w"> </span>set-default<span class="w"> </span>graphical.target
</pre></div>
</div>
</li>
<li><p>Reboot the system and log back in.</p></li>
<li><p>Trigger a <strong class="command">flatpak update</strong> to download the runtime corresponding
with the new NVIDIA drivers for the flatpak apps that require it.</p>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>Some flatpak applications wont start after updating the NVIDIA drivers
until the flatpak runtime is updated with the corresponding driver
version.</p>
</div>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>flatpak<span class="w"> </span>update
</pre></div>
</div>
</li>
</ol>
</section>
<section id="uninstallation">
<h2><a class="toc-backref" href="#id5" role="doc-backlink">Uninstallation</a><a class="headerlink" href="#uninstallation" title="Link to this heading"></a></h2>
<p>The NVIDIA drivers and associated software can be uninstalled and nouveau
driver restored with the instructions in this section.</p>
<ol class="arabic">
<li><p>Remove the files created for workarounds.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>rm<span class="w"> </span>/etc/kernel/cmdline-removal.d/intel-iommu.conf
sudo<span class="w"> </span>rm<span class="w"> </span>/etc/systemd/system/fix-nvidia-libGL-trigger.service
sudo<span class="w"> </span>rm<span class="w"> </span>/etc/systemd/system/update-triggers.target.wants/fix-nvidia-libGL-trigger.service
sudo<span class="w"> </span>systemctl<span class="w"> </span>daemon-reload
</pre></div>
</div>
</li>
<li><p>Remove the <code class="file docutils literal notranslate"><span class="pre">modprobe.d</span></code> file that prevents nouveau from loading.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>rm<span class="w"> </span>/etc/modprobe.d/disable-nouveau.conf
</pre></div>
</div>
</li>
<li><p>Remove the <code class="file docutils literal notranslate"><span class="pre">nvidia.conf</span></code> file so that dynamic linker does not
look for cached libraries under <code class="file docutils literal notranslate"><span class="pre">/opt/nvidia/lib</span></code> and <code class="file docutils literal notranslate"><span class="pre">/opt/nvidia/lib32</span></code>.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>rm<span class="w"> </span>/etc/ld.so.conf.d/nvidia.conf
sudo<span class="w"> </span>ldconfig
</pre></div>
</div>
<p>Optionally, restore <code class="file docutils literal notranslate"><span class="pre">ld.so.conf</span></code> to default if no other configuration files under <code class="file docutils literal notranslate"><span class="pre">/etc/ld.so.conf.d</span></code>
needs to be included.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>sed<span class="w"> </span>-i<span class="w"> </span><span class="s1">&#39;/^include \/etc\/ld\.so\.conf\.d\/\*\.conf$/d&#39;</span><span class="w"> </span>/etc/ld.so.conf
</pre></div>
</div>
</li>
<li><p>Remove the <code class="file docutils literal notranslate"><span class="pre">xorg.conf.d</span></code> file that adds a search path for X modules.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>rm<span class="w"> </span>/etc/X11/xorg.conf.d/nvidia-files-opt.conf
</pre></div>
</div>
</li>
<li><p>Remove the nvidia-settings desktop entry file if it was linked to
<code class="file docutils literal notranslate"><span class="pre">~/.local/share/applications</span></code>.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>unlink<span class="w"> </span>-v<span class="w"> </span><span class="nv">$HOME</span>/.local/share/applications/nvidia-settings.desktop
</pre></div>
</div>
</li>
<li><p>Run the <strong class="command">nvidia-uninstall</strong> command.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>/opt/nvidia/bin/nvidia-uninstall
</pre></div>
</div>
</li>
<li><p>Follow the prompts on the screen and reboot the system.</p></li>
</ol>
</section>
<section id="troubleshooting">
<h2><a class="toc-backref" href="#id6" role="doc-backlink">Troubleshooting</a><a class="headerlink" href="#troubleshooting" title="Link to this heading"></a></h2>
<ul class="simple">
<li><p>The NVIDIA driver places installer and uninstaller logs under
<code class="file docutils literal notranslate"><span class="pre">/var/log/nvidia-install</span></code> and <code class="file docutils literal notranslate"><span class="pre">/var/log/nvidia-uninstall</span></code>.</p></li>
<li><p><code class="file docutils literal notranslate"><span class="pre">NVIDIA-Linux-x86_64-&lt;VERSION&gt;.run</span> <span class="pre">--advanced-options</span></code> shows many
parameters to control installation behavior.</p></li>
<li><p><code class="file docutils literal notranslate"><span class="pre">NVIDIA-Linux-x86_64-&lt;VERSION&gt;.run</span> <span class="pre">--extract-only</span></code> extracts
installation files into a directory named
<code class="file docutils literal notranslate"><span class="pre">NVIDIA-Linux-x86_64-&lt;VERSION&gt;</span></code>.</p></li>
<li><p>The X server logs under <code class="file docutils literal notranslate"><span class="pre">/var/log/X*</span></code> contain useful
information about display and driver loading. Check all the files and
timestamps when troubleshooting.</p></li>
<li><p>The DKMS build logs under <code class="file docutils literal notranslate"><span class="pre">/var/lib/dkms/nvidia*</span></code> contain information
about kernel module builds which can be useful if the NVIDIA driver breaks
between kernel upgrades.</p></li>
</ul>
<section id="no-display-or-blank-screen">
<h3>No display or blank screen<a class="headerlink" href="#no-display-or-blank-screen" title="Link to this heading"></a></h3>
<p>Check to see if the display has come up on another graphics device, including
the integrated graphics device.</p>
<p>You might get a black screen or the login screen might not come up after
installing the NVIDIA drivers until an Xorg configuration has been defined for
your monitors.</p>
</section>
<section id="oh-no-something-has-gone-wrong-gnome-crash">
<h3>“Oh no! Something has gone wrong” GNOME* crash<a class="headerlink" href="#oh-no-something-has-gone-wrong-gnome-crash" title="Link to this heading"></a></h3>
<figure class="align-center" id="id1">
<img alt="NVIDIA driver GNOME crash on Clear Linux OS" src="../_images/nvidia-gnome-crash.png" />
<figcaption>
<p><span class="caption-text">NVIDIA driver GNOME crash dialogue on Clear Linux OS.</span><a class="headerlink" href="#id1" title="Link to this image"></a></p>
</figcaption>
</figure>
<p>There have been reports of GNOME crashing with an “Oh no! Something has gone
wrong” error message with NVIDIA drivers installed while other graphics
devices are enabled.</p>
<p>Try disabling other graphics devices, including integrated graphics, in your
systems EFI/BIOS.</p>
</section>
<section id="slow-boot-times">
<h3>Slow boot times<a class="headerlink" href="#slow-boot-times" title="Link to this heading"></a></h3>
<p>There have been reports of slow boot times with NVIDIA drivers installed.
Normally, when GDM detects NVIDIA proprietary drivers, it will disable Wayland
and enable X11. Should GDM fail to disbale Wayland, it may results in slow boot
times, according to <a class="reference external" href="https://github.com/clearlinux/distribution/issues/1780">this GitHub reprot</a>.</p>
<p>To manually disable Wayland:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>tee<span class="w"> </span>/etc/gdm/custom.conf<span class="w"> </span>&gt;<span class="w"> </span>/dev/null<span class="w"> </span><span class="s">&lt;&lt;&#39;EOF&#39;</span>
<span class="s">[daemon]</span>
<span class="s">WaylandEnable=false</span>
<span class="s">EOF</span>
</pre></div>
</div>
</section>
<section id="brightness-control">
<h3>Brightness control<a class="headerlink" href="#brightness-control" title="Link to this heading"></a></h3>
<p>If you cant control the screen brightness with the NVIDIA driver installed,
try one of the solutions below:</p>
<ul>
<li><p>Add a kernel parameter <em>acpi_osi=</em> which disables the ACPI Operating System
Identification function. Some system firmware may manipulate brightness
control keys based on the reported operating system. Disabling the
identification mechanism can cause the system firmware to expose brightness
controls that are recognizable in Linux.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>mkdir<span class="w"> </span>-p<span class="w"> </span>/etc/kernel/cmdline.d
<span class="nb">echo</span><span class="w"> </span><span class="s2">&quot;acpi_osi=&quot;</span><span class="w"> </span><span class="p">|</span><span class="w"> </span>sudo<span class="w"> </span>tee<span class="w"> </span>/etc/kernel/cmdline.d/acpi-backlight.conf
sudo<span class="w"> </span>clr-boot-manager<span class="w"> </span>update
</pre></div>
</div>
</li>
<li><p>Add a kernel parameter for the nvidia driver:
<em>NVreg_EnableBacklightHandler=1</em>. This handler overrides the ACPI-based one
provided by the video.ko kernel module. This option is available with NVIDIA
driver version 387.22 and above.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>mkdir<span class="w"> </span>-p<span class="w"> </span>/etc/kernel/cmdline.d
<span class="nb">echo</span><span class="w"> </span><span class="s2">&quot;nvidia.NVreg_EnableBacklightHandler=1&quot;</span><span class="w"> </span><span class="p">|</span><span class="w"> </span>sudo<span class="w"> </span>tee<span class="w"> </span>/etc/kernel/cmdline.d/nvidia-backlight.conf
sudo<span class="w"> </span>clr-boot-manager<span class="w"> </span>update
</pre></div>
</div>
</li>
<li><p>Add the <em>EnableBrightnessControl=1</em> options to the <em>Device</em>
section of your xorg config. Below is an example:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>mkdir<span class="w"> </span>-p<span class="w"> </span>/etc/X11/xorg.conf.d/
sudo<span class="w"> </span>tee<span class="w"> </span>/etc/X11/xorg.conf.d/nvidia-brightness.conf<span class="w"> </span>&gt;<span class="w"> </span>/dev/null<span class="w"> </span><span class="s">&lt;&lt;&#39;EOF&#39;</span>
<span class="s">Section &quot;Device&quot;</span>
<span class="s"> Identifier &quot;Device0&quot;</span>
<span class="s"> Driver &quot;nvidia&quot;</span>
<span class="s"> Option &quot;RegistryDwords&quot; &quot;EnableBrightnessControl=1&quot;</span>
<span class="s">EndSection</span>
<span class="s">EOF</span>
</pre></div>
</div>
</li>
</ul>
</section>
<section id="additional-resources">
<h3>Additional resources<a class="headerlink" href="#additional-resources" title="Link to this heading"></a></h3>
<ul class="simple">
<li><p><a class="reference external" href="https://nvidia.custhelp.com/app/answers/detail/a_id/1849/kw/Linux">Why arent the NVIDIA Linux drivers open source?</a></p></li>
<li><p><a class="reference external" href="https://nvidia.custhelp.com/app/answers/detail/a_id/44/kw/linux">Where can I get support for NVIDIA Linux drivers?</a></p></li>
<li><p><a class="reference external" href="https://download.nvidia.com/XFree86/Linux-x86_64/">NVIDIA Accelerated Linux Graphics Driver Installation Guides</a></p></li>
</ul>
<p><em>Intel and the Intel logo are trademarks of Intel Corporation or its subsidiaries.</em></p>
</section>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/clearlinux.png" alt="Logo of Clear Linux* Project Docs"/>
</a></p>
<div>
<h3><a href="../index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">NVIDIA* Drivers</a><ul>
<li><a class="reference internal" href="#prerequisites">Prerequisites</a><ul>
<li><a class="reference internal" href="#known-issues">Known issues</a></li>
</ul>
</li>
<li><a class="reference internal" href="#installation">Installation</a><ul>
<li><a class="reference internal" href="#configure-workarounds">Configure workarounds</a></li>
<li><a class="reference internal" href="#install-dkms">Install DKMS</a></li>
<li><a class="reference internal" href="#download-the-nvidia-drivers">Download the NVIDIA drivers</a></li>
<li><a class="reference internal" href="#disable-the-nouveau-driver">Disable the nouveau driver</a></li>
<li><a class="reference internal" href="#configure-alternative-software-paths">Configure alternative software paths</a></li>
<li><a class="reference internal" href="#install-the-nvidia-drivers">Install the NVIDIA drivers</a></li>
</ul>
</li>
<li><a class="reference internal" href="#updating">Updating</a></li>
<li><a class="reference internal" href="#uninstallation">Uninstallation</a></li>
<li><a class="reference internal" href="#troubleshooting">Troubleshooting</a><ul>
<li><a class="reference internal" href="#no-display-or-blank-screen">No display or blank screen</a></li>
<li><a class="reference internal" href="#oh-no-something-has-gone-wrong-gnome-crash">“Oh no! Something has gone wrong” GNOME* crash</a></li>
<li><a class="reference internal" href="#slow-boot-times">Slow boot times</a></li>
<li><a class="reference internal" href="#brightness-control">Brightness control</a></li>
<li><a class="reference internal" href="#additional-resources">Additional resources</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div>
<h4>Previous topic</h4>
<p class="topless"><a href="mirror-upstream-server.html"
title="previous chapter">Mirror Upstream Clear Linux OS Update Server</a></p>
</div>
<div>
<h4>Next topic</h4>
<p class="topless"><a href="nvidia-cuda.html"
title="next chapter">NVIDIA* CUDA Toolkit</a></p>
</div>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/tutorials/nvidia.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<search id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="Related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="nvidia-cuda.html" title="NVIDIA* CUDA Toolkit"
>next</a> |</li>
<li class="right" >
<a href="mirror-upstream-server.html" title="Mirror Upstream Clear Linux OS Update Server"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Documentation for Clear Linux* project</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="index.html" >Tutorials</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">NVIDIA* Drivers</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2022 Intel Corporation. All Rights Reserved..
Last updated on Nov 04, 2024.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.1.3.
</div>
</body>
</html>