Installation Guide for Linux, Release 12.6
Table 9: Advanced Setup Scenarios when Installing CUDA
Scenario Instructions
Install CUDA using the Package Manager instal-
lation method without installing the NVIDIA GL
libraries.
Fedora
Install CUDA using the following command:
sudo dnf install cuda-toolkit-12-4 \
nvidia-driver-cuda akmod-nvidia
Follow the instructions here to ensure that Nou-
veau is disabled.
If performing an upgrade over a previous instal-
lation, the NVIDIA kernel module may need to be
rebuilt by following the instructions here.
OpenSUSE/SLES
On some system congurations the NVIDIA GL li-
braries may need to be locked before installation
using:
sudo zypper addlock nvidia-glG04
Install CUDA using the following command:
sudo zypper install --no-recommends cuda-
,→toolkit-12-4 \
nvidia-computeG04 \
nvidia-gfxG04-kmp-default
Follow the instructions here to ensure that Nou-
veau is disabled.
Ubuntu
This functionality isn’t supported on Ubuntu. In-
stead, the driver packages integrate with the
Bumblebee framework to provide a solution for
users who wish to control what applications the
NVIDIA drivers are used for. See Ubuntu’s Bum-
blebee wiki for more information.
Upgrade from a RPM/Deb driver installation
which includes the diagnostic driver packages to
a
driver installation which does not include the di-
agnostic driver packages.
RHEL/CentOS
Remove diagnostic packages using the following
command:
sudo yum remove cuda-drivers-diagnostic \
xorg-x11-drv-nvidia-diagnostic
Follow the instructions here to continue installa-
tion as normal.
Fedora
Remove diagnostic packages using the following
command:
sudo dnf remove cuda-drivers-diagnostic \
xorg-x11-drv-nvidia-diagnostic
Follow the instructions here to continue installa-
tion as normal.
OpenSUSE/SLES
Remove diagnostic packages using the following
command:
sudo zypper remove cuda-drivers-
,→diagnostic \
nvidia-diagnosticG04
Follow the instructions here to continue installa-
tion as normal.
Ubuntu
Remove diagnostic packages using the following
command:
sudo apt-get purge cuda-drivers-
,→diagnostic \
nvidia-384-diagnostic
Follow the instructions here to continue installa-
tion as normal.
Use a specic GPU for rendering the display. Add or replace a Device entry in your xorg.conf
le, located at ∕etc∕X11∕xorg.conf. The De-
vice entry should resemble the following:
Section "Device"
Identifier "Device0"
Driver "driver_name"
VendorName "vendor_name"
BusID "bus_id"
EndSection
The details will you will need to add dier
on a case-by-case basis. For example, if you
have two NVIDIA GPUs and you want the rst
GPU to be used for display, you would replace
“driver_name” with “nvidia”, “vendor_name”
with “NVIDIA Corporation” and “bus_id” with
the Bus ID of the GPU. The Bus ID will resem-
ble “PCI:00:02.0” and can be found by running
lspci.
Install CUDA to a specic directory using the
Package Manager installation method.
RPM
The RPM packages don’t support custom in-
stall locations through the package managers
(Yum and Zypper), but it is possible to install the
RPM packages to a custom location using rpm’s
--relocate parameter:
sudo rpm --install --relocate ∕usr∕local∕
,→cuda-12.4=∕new∕toolkit package.rpm
You will need to install the packages in the cor-
rect dependency order; this task is normally
taken care of by the package managers. For
example, if package “foo” has a dependency on
package “bar”, you should install package “bar”
rst, and package “foo” second. You can check
the dependencies of a RPM package as follows:
rpm -qRp package.rpm
Note that the driver packages cannot be relo-
cated.
Deb
The Deb packages do not support custom install
locations. It is however possible to extract the
contents of the Deb packages and move the les
to the desired install location. See the next sce-
nario for more details one xtracting Deb pack-
ages.
Extract the contents of the installers. Runle
The Runle can be extracted into the stan-
dalone Toolkit and Driver Runles by using the
--extract parameter. The Toolkit standalone
Runles can be further extracted by running:
.∕runfile.run --tar mxvf
The Driver Runle can be extracted by running:
.∕runfile.run -x
RPM
The RPM packages can be extracted by running:
rpm2cpio package.rpm | cpio -idmv
Deb
The Deb packages can be extracted by running:
dpkg-deb -x package.deb output_dir
Modify Ubuntu’s apt package manager to query
specic architectures for specic repositories.
This is useful when a foreign architecture has
been added, causing “404 Not Found” errors to
appear when the repository meta-data is up-
dated.
Each repository you wish to restrict to spe-
cic architectures must have its sources.
list entry modied. This is done by modify-
ing the ∕etc∕apt∕sources.list le and any
les containing repositories you wish to restrict
under the ∕etc∕apt∕sources.list.d∕ direc-
tory. Normally, it is sucient to modify only the
entries in ∕etc∕apt∕sources.list
An architecture-restricted repository entry looks
like:
deb [arch=<arch1>,<arch2>] <url>
For example, if you wanted to restrict a reposi-
tory to only the amd64 and i386 architectures, it
would look like:
deb [arch=amd64,i386] <url>
It is not necessary to restrict the deb-src
repositories, as these repositories don’t provide
architecture-specic packages.
For more details, see the sources.list man-
page.
The nvidia.ko kernel module fails to load, saying
some symbols are unknown.
For example:
nvidia: Unknown symbol drm_open (err 0)
Check to see if there are any optionally installable
modules that might provide these symbols which
are not currently installed.
For the example of the drm_open symbol,
check to see if there are any packages which
provide drm_open and are not already in-
stalled. For instance, on Ubuntu 14.04, the
linux-image-extra package provides the
DRM kernel module (which provides drm_open).
This package is optional even though the kernel
headers reect the availability of DRM regard-
less of whether this package is installed or
not.
The runle installer fails to extract due to limited
space in the TMP directory.
This can occur on systems with limited storage
in the TMP directory (usually
∕tmp
), or on sys-
tems which use a tmpfs in memory to handle
temporary storage. In this case, the --tmpdir
command-line option should be used to instruct
the runle to use a directory with sucient
space to extract into. More information on this
option can be found here.
Re-enable Wayland after installing the RPM
driver on Fedora.
Wayland is disabled during installation of the Fe-
dora driver RPM due to compatability issues. To
re-enable Wayland, comment out this line in ∕
etc∕gdm∕custom.conf:
WaylandEnable=false
In case of the error: E: Failed to fetch
file:∕var∕cuda-repo File not found
Debian and Ubuntu
This can occur when installing CUDA after unin-
stalling a dierent version. Use the following
command before installation:
sudo rm -v ∕var∕lib∕apt∕lists∕*cuda* ∕
,→var∕lib∕apt∕lists∕*nvidia*
Verbose installation on Debian and Ubuntu Use the --verbose-versions ag, for exam-
ple:
sudo apt-get install --verbose-versions�
,→cuda
78 Chapter 17. Advanced Setup