8

I have a headless box that will be used for CUDA computing. I installed Ubuntu server 16.04.1 but when I try to install the nVidia drivers via apt-get it also wants me to install X11 and other GUI components.

How can I just install the driver and CUDA libs without installing X11 and friends?

Ideally without downloading the run file directly from nVidia. I'd like to use debian packages if possible.

7

This worked for me (on Ubuntu 16.04):

# apt-get -y install nvidia-cuda-toolkit lightdm-

lightdm is the windows manager that nvidia-* installs. The dash at the end tells apt-get to uninstall the package but dependency resolution figures out not to install it in the first place. This still installed xserver-common (so you still get some X11 stuff) but it did not enable graphical booting. (Adding xserver-common- resulted in broken dependencies.)

PS. You're probably past this problem but this answer is for future internet generations.

  • Thank you. I can vouch that ligthdm- works, even when installing from the official deb. – rpmcruz May 25 '18 at 11:59
3

sudo apt-get -s install --no-install-recommends nvidia-current seem to be rather sparse with the dependencies on my box, but it already has a full graphical environment.

What you could in theory do is:

  1. Let apt-get download the pkg without install: sudo apt-get -d install nvidia-current
  2. Pick up the desired deb from the cache: ls /var/cache/apt/archives/ | grep nvidia-
  3. Install using dpkg, ignoring relevant dependencies: dpkg -i --ignore-depends=package1,package2 package3.deb

Dependencies are of course there for a reason, if I where in your situation I'd just let apt do its thing. Some X11-software won't hurt you much unless you run it.

1

If running (say, Blender on a headless server, you don't need all those dependencies.

Download the CUDA drivers from as a runfile from: https://developer.nvidia.com/cuda-downloads

Run sudo sh cuda_8.0.44_linux.run (or newer version)

Download the NVIDIA drivers from http://www.nvidia.com/Download/index.aspx?lang=en-us

Run: sudo sh /backup/iso/NVIDIA-Linux-x86_64-367.44.run (or newer version)

Note: Every time you update to a newer kernel, you'll have to reload the driver for that kernel. So you may want to add the "-a" (accept license terms) flag after going through them once.

My setup:

  • headless Xubuntu 16.04
  • dual GeForce 970 cards
  • Blender 2.78

Enjoy!

  • Many unneeded dependencies not installed this way:» apt-get -s install nvidia-current | grep newly 0 upgraded, 65 newly installed, 0 to remove and 0 not upgraded. – Fen Oct 21 '16 at 19:25

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.