How to install nvidia driver for cuda without installing X11?

VINOTH: <p>Hii,</p>
<p>I am using the ubuntu server 20.04LTS Operating system.</p>
<p>I looking to install Nvidia drivers on my server.<br>
I need to install it without a headless because I don’t want to use GUI.</p>
<p>I don’t want to Install X11.</p>
<p>How to do this Please help with this issue.</p>
<p>Thank you.</p>

eqy: <p>I think by default you should be able to install the driver packages without using a GUI or X11</p><aside class="onebox allowlistedgeneric" data-onebox-src="https://docs.nvidia.com/cuda/cuda-quick-start-guide/index.html#linux">
  <header class="source">

      <a href="https://docs.nvidia.com/cuda/cuda-quick-start-guide/index.html#linux" target="_blank" rel="noopener nofollow ugc">docs.nvidia.com</a>
  </header>

  <article class="onebox-body">
    

<h3><a href="https://docs.nvidia.com/cuda/cuda-quick-start-guide/index.html#linux" target="_blank" rel="noopener nofollow ugc">Quick Start Guide :: CUDA Toolkit Documentation</a></h3>

  <p>Minimal first-steps instructions to get CUDA running on a standard system.</p>


  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>
<p>
, though depending on the system it may install X11 as a side-effect.</p>
<p>Some workarounds for the second part might be here:</p><aside class="onebox stackexchange" data-onebox-src="https://askubuntu.com/questions/830983/how-to-install-nvidia-drivers-to-use-cuda-without-also-installing-x11">
  <header class="source">

      <a href="https://askubuntu.com/questions/830983/how-to-install-nvidia-drivers-to-use-cuda-without-also-installing-x11" target="_blank" rel="noopener nofollow ugc">askubuntu.com</a>
  </header>

  <article class="onebox-body">
      <a href="https://askubuntu.com/users/149316/en4bz" target="_blank" rel="noopener nofollow ugc">
    <img alt="en4bz" src="https://www.gravatar.com/avatar/45df6792adc1ce410dd509ce7a53a681?s=256&amp;d=identicon&amp;r=PG" class="thumbnail onebox-avatar" width="256" height="256">
  </a>

<h4>
  <a href="https://askubuntu.com/questions/830983/how-to-install-nvidia-drivers-to-use-cuda-without-also-installing-x11" target="_blank" rel="noopener nofollow ugc">How to install Nvidia drivers to use CUDA without also installing X11?</a>
</h4>

<div class="tags">
  <strong>server, nvidia, software-installation, xorg</strong>
</div>

<div class="date">
  asked by
  
  <a href="https://askubuntu.com/users/149316/en4bz" target="_blank" rel="noopener nofollow ugc">
    en4bz
  </a>
  on <a href="https://askubuntu.com/questions/830983/how-to-install-nvidia-drivers-to-use-cuda-without-also-installing-x11" target="_blank" rel="noopener nofollow ugc">03:10AM - 29 Sep 16 UTC</a>
</div>

  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>


VINOTH: <p>Dear eqy,</p>
<p>I tried the second part with headless installation. but, it didn’t work for me. there were some errors in downloading.</p>
<p>Could you please share any commands to solve this?</p>
<p>I am very new to installing Nvidia drivers on the ubuntu server.</p>

eqy: <p>Was the command you tried something like</p>
<pre><code class="lang-auto">sudo apt install --no-install-recommends nvidia-cuda-toolkit nvidia-headless-510 nvidia-utils-510
</code></pre>
<p>?<br>
Could you share what the error message was?</p>

VINOTH: <p>Dear eqy,</p>
<p>First, I tried to download the Nvidia driver using this command.</p>
<pre><code class="lang-auto">
&gt; sudo apt install --no-install-recommends nvidia-cuda-toolkit nvidia-headless-510 nvidia-utils-510

</code></pre>
<p>Then the error message is like this at the end:</p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/2/b/2b30bbb2ea1aecba716459b6715c40d3c7f4ab79.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/2b30bbb2ea1aecba716459b6715c40d3c7f4ab79" title="image_50423041"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/2/b/2b30bbb2ea1aecba716459b6715c40d3c7f4ab79_2_666x500.jpeg" alt="image_50423041" data-base62-sha1="6a4WnBS9m5wfS5Q03WJVBUSLCtP" width="666" height="500" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/2/b/2b30bbb2ea1aecba716459b6715c40d3c7f4ab79_2_666x500.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/2/b/2b30bbb2ea1aecba716459b6715c40d3c7f4ab79_2_999x750.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/2/b/2b30bbb2ea1aecba716459b6715c40d3c7f4ab79_2_1332x1000.jpeg 2x" data-dominant-color="7B766F"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image_50423041</span><span class="informations">1920×1440 221 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>After rebooting my system, I tried to check using this <code>nvidia-smi</code> command, but it shows failed to communicate with the NVIDIA driver.</p>
<p>Thank you.</p>

eqy: <p>I’m not familiar with this exact issue, but this thread looks like it could be related?<br>
<a href="https://askubuntu.com/questions/1241738/how-to-fix-the-nvidia-dkms-440-x-configuration-failure-on-ubuntu-20-04" rel="noopener nofollow ugc">upgrade - How to fix the nvidia-dkms-440-x configuration failure on ubuntu 20.04 - Ask Ubuntu</a></p>
<p>e.g., reinstalling build/compiler tools<br>
<code>sudo apt reinstall build-essential</code><br>
might help.</p>

VINOTH: <p>Dear eqy,</p>
<p>Thank you so much. It’s working properly now. cheers!</p>