Score:1

Trying to install CUDA, but getting errors

co flag

I have tried a number of solutions suggested here and only when I try to install cuda. But I keep getting the following errors when I do the following

sudo apt install -y cuda

Errors were encountered while processing:

 nvidia-dkms-450
 nvidia-driver-450
 cuda-drivers-450
 cuda-drivers
 cuda-runtime-11-0
 cuda-11-0
 cuda-demo-suite-11-0
 cuda
E: Sub-process /usr/bin/dpkg returned an error code (1)

This is for Ubuntu 20.04.

Nmath avatar
ng flag
Please edit your question and include the whole unredacted output. Are you running `sudo apt update` before other commands in `apt`? Is all of your software up-to-date before attempting to install new software?
Nate T avatar
it flag
The i386 package is only necessary for systems using 32 bit architecture.
Score:1
it flag

You need to download the drivers first. Try first running this

sudo apt install libnvidia-tesla-cuda1 libnvidia-tesla-cuda1-i386

then running your install command when Apt is finished with this one.

This is the description from apt search :

NVIDIA CUDA Driver Library (Tesla version)

EDIT

After doing more research on the question, I found the official documentation which includes installation instructions. As it turns out, there is a bit more to the process:

Perform the pre-installation actions.

Install repository meta-data

    $ sudo dpkg -i cuda-repo-<distro>_<version>_<architecture>.deb

Install the CUDA public GPG key

When installing using the local repo:

    $ sudo apt-key add /var/cuda-repo-<distro>-<version>/7fa2af80.pub

When installing using network repo on Ubuntu 20.04/18.04:

    $ sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/<distro>/<architecture>/7fa2af80.pub

When installing using network repo on Ubuntu 16.04:

    $ sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/<distro>/<architecture>/7fa2af80.pub

Pin file to prioritize CUDA repository:

    $ wget https://developer.download.nvidia.com/compute/cuda/repos/<distro>/<architecture>/cuda-<distro>.pin
    $ sudo mv cuda-<distro>.pin /etc/apt/preferences.d/cuda-repository-pin-600

Update the Apt repository cache

    $ sudo apt-get update

Install CUDA Note: These two commands must be executed separately.

    $ sudo apt-get install cuda

To include all GDS packages:

    $ sudo apt-get install nvidia-gds 

Perform the post-installation actions.

SOURCES

Official Installation Guide

Section on Apt based install on Ubuntu

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.