Skip to content

Commit 3361e2d

Browse files
authored
docs: update: improve the Fedoa CUDA guide (ggml-org#12536)
* docs: update fedora-cuda guide - Rename and place into Backend Folder. - Update Host-Supplied Packages. - Expand Recommended Users Section. * docs: improve the flow of CUDA-FEDORA.md
1 parent 00d5380 commit 3361e2d

File tree

2 files changed

+45
-30
lines changed

2 files changed

+45
-30
lines changed

docs/cuda-fedora.md renamed to docs/backend/CUDA-FEDORA.md

Lines changed: 39 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ In this guide we setup [Nvidia CUDA](https://docs.nvidia.com/cuda/) in a toolbox
1414
- [Creating a Fedora Toolbox Environment](#creating-a-fedora-toolbox-environment)
1515
- [Installing Essential Development Tools](#installing-essential-development-tools)
1616
- [Adding the CUDA Repository](#adding-the-cuda-repository)
17-
- [Installing `nvidia-driver-libs`](#installing-nvidia-driver-libs)
18-
- [Manually Resolving Package Conflicts](#manually-resolving-package-conflicts)
19-
- [Finalizing the Installation of `nvidia-driver-libs`](#finalizing-the-installation-of-nvidia-driver-libs)
17+
- [Installing Nvidia Driver Libraries](#installing-nvidia-driver-libraries)
2018
- [Installing the CUDA Meta-Package](#installing-the-cuda-meta-package)
2119
- [Configuring the Environment](#configuring-the-environment)
2220
- [Verifying the Installation](#verifying-the-installation)
@@ -67,7 +65,7 @@ This guide focuses on Fedora hosts, but with small adjustments, it can work for
6765
sudo dnf distro-sync
6866
```
6967

70-
2. **Install the Default Text Editor (Optional):**
68+
2. **Install **Vim** the default text editor (Optional):**
7169

7270
```bash
7371
sudo dnf install vim-default-editor --allowerasing
@@ -97,60 +95,75 @@ After adding the repository, synchronize the package manager again:
9795
sudo dnf distro-sync
9896
```
9997

100-
## Installing `nvidia-driver-libs` and `nvidia-driver-cuda-libs`
98+
## Installing Nvidia Driver Libraries
10199

102-
We need to detect if the host is supplying the [NVIDIA driver libraries into the toolbox](https://github.com/containers/toolbox/blob/main/src/pkg/nvidia/nvidia.go).
100+
First, we need to detect if the host is supplying the [NVIDIA driver libraries into the toolbox](https://github.com/containers/toolbox/blob/main/src/pkg/nvidia/nvidia.go):
103101

104102
```bash
105103
ls -la /usr/lib64/libcuda.so.1
106104
```
107105

108-
**Explanation:**
106+
### If *`libcuda.so.1`* is missing:
107+
108+
```
109+
ls: cannot access '/usr/lib64/libcuda.so.1': No such file or directory
110+
```
109111

110-
- `nvidia-driver-libs` and `nvidia-driver-cuda-libs` contains necessary NVIDIA driver libraries required by CUDA,
111-
on hosts with NVIDIA drivers installed the Fedora Container will supply the host libraries.
112+
**Explanation:**
113+
The host dose not supply the CUDA drivers, **install them now:**
112114

113-
### Install Nvidia Driver Libraries on Guest (if `libcuda.so.1` was NOT found).
115+
#### Install the Nvidia Driver Libraries on Guest:
114116

115117
```bash
116-
sudo dnf install nvidia-driver-libs nvidia-driver-cuda-libs
118+
sudo dnf install nvidia-driver-cuda nvidia-driver-libs nvidia-driver-cuda-libs nvidia-persistenced
117119
```
118120

119-
### Manually Updating the RPM database for host-supplied NVIDIA drivers (if `libcuda.so.1` was found).
121+
### If *`libcuda.so.1`* exists:
122+
```
123+
lrwxrwxrwx. 1 root root 21 Mar 24 11:26 /usr/lib64/libcuda.so.1 -> libcuda.so.570.133.07
124+
```
125+
126+
**Explanation:**
127+
The host is supply the CUDA drivers, **we need to update the guest RPM Database accordingly:**
120128

121-
If the installation fails due to conflicts, we'll manually download and install the required packages, excluding conflicting files.
129+
#### Update the Toolbox RPM Database to include the Host-Supplied Libraries:
122130

123-
#### 1. Download `nvidia-driver-libs` and `nvidia-driver-cuda-libs` RPM's (with dependencies)
131+
Note: we do not actually install the libraries, we just update the DB so that the guest system knows they are supplied by the host.
132+
133+
##### 1. Download `nvidia-` parts that are supplied by the host RPM's (with dependencies)
124134

125135
```bash
126-
sudo dnf download --destdir=/tmp/nvidia-driver-libs --resolve --arch x86_64 nvidia-driver-libs nvidia-driver-cuda-libs
136+
sudo dnf download --destdir=/tmp/nvidia-driver-libs --resolve --arch x86_64 nvidia-driver-cuda nvidia-driver-libs nvidia-driver-cuda-libs nvidia-persistenced
127137
```
128138

129-
#### 2. Update the RPM database to assume the installation of these packages.
139+
##### 2. Update the RPM database to assume the installation of these packages.
130140

131141
```bash
132142
sudo rpm --install --verbose --hash --justdb /tmp/nvidia-driver-libs/*
133143
```
134144

135145
**Note:**
136146

137-
- The `--justdb` option only updates the RPM database, without touching the filesystem.
147+
- The `--justdb` option only updates the RPM database, without touching the filesystem elsewhere.
148+
149+
##### Check that the RPM Database has been correctly updated:
138150

139-
#### Finalizing the Installation of `nvidia-driver-libs` and `nvidia-driver-cuda-libs`
151+
**Note:** This is the same command as in the *"Install the Nvidia Driver Libraries on Guest"* for if *`libcuda.so.1`* was missing.
140152

141-
After manually installing the dependencies, run:
142153

143154
```bash
144-
sudo dnf install nvidia-driver-libs nvidia-driver-cuda-libs
155+
sudo dnf install nvidia-driver-cuda nvidia-driver-libs nvidia-driver-cuda-libs nvidia-persistenced
145156
```
146157

147-
You should receive a message indicating the package is already installed:
158+
*(this time it will not install anything, as the database things that these packages are already installed)*
148159

149160
```
150161
Updating and loading repositories:
151162
Repositories loaded.
152-
Package "nvidia-driver-libs-3:570.86.10-1.fc41.x86_64" is already installed.
153-
Package "nvidia-driver-cuda-libs-3:570.86.10-1.fc41.x86_64" is already installed.
163+
Package "nvidia-driver-cuda-3:570.124.06-1.fc41.x86_64" is already installed.
164+
Package "nvidia-driver-libs-3:570.124.06-1.fc41.x86_64" is already installed.
165+
Package "nvidia-driver-cuda-libs-3:570.124.06-1.fc41.x86_64" is already installed.
166+
Package "nvidia-persistenced-3:570.124.06-1.fc41.x86_64" is already installed.
154167
155168
Nothing to do.
156169
```
@@ -207,9 +220,9 @@ You should see output similar to:
207220
```
208221
nvcc: NVIDIA (R) Cuda compiler driver
209222
Copyright (c) 2005-2025 NVIDIA Corporation
210-
Built on Wed_Jan_15_19:20:09_PST_2025
211-
Cuda compilation tools, release 12.8, V12.8.61
212-
Build cuda_12.8.r12.8/compiler.35404655_0
223+
Built on Fri_Feb_21_20:23:50_PST_2025
224+
Cuda compilation tools, release 12.8, V12.8.93
225+
Build cuda_12.8.r12.8/compiler.35583870_0
213226
```
214227

215228
This output confirms that the CUDA compiler is accessible and indicates the installed version.

docs/build.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,14 @@ You may find the official downloads here: [NVIDIA developer site](https://develo
132132
133133
134134
#### Compile and run inside a Fedora Toolbox Container
135-
We also have a [guide](./cuda-fedora.md) for setting up CUDA toolkit in a Fedora [toolbox container](https://containertoolbx.org/).
135+
We also have a [guide](./backend/CUDA-FEDORA.md) for setting up CUDA toolkit in a Fedora [toolbox container](https://containertoolbx.org/).
136136
137137
**Recommended for:**
138-
139-
- ***Particularly*** *convenient* for users of [Atomic Desktops for Fedora](https://fedoraproject.org/atomic-desktops/); such as: [Silverblue](https://fedoraproject.org/atomic-desktops/silverblue/) and [Kinoite](https://fedoraproject.org/atomic-desktops/kinoite/).
140-
- Toolbox is installed by default: [Fedora Workstation](https://fedoraproject.org/workstation/) or [Fedora KDE Plasma Desktop](https://fedoraproject.org/spins/kde).
138+
- ***Necessary*** for users of [Atomic Desktops for Fedora](https://fedoraproject.org/atomic-desktops/); such as: [Silverblue](https://fedoraproject.org/atomic-desktops/silverblue/) and [Kinoite](https://fedoraproject.org/atomic-desktops/kinoite/).
139+
- (there are no supported CUDA packages for these systems)
140+
- ***Necessary*** for users that have a host that is not a: [Supported Nvidia CUDA Release Platform](https://developer.nvidia.com/cuda-downloads).
141+
- (for example, you may have [Fedora 42 Beta](https://fedoramagazine.org/announcing-fedora-linux-42-beta/) as your your host operating system)
142+
- ***Convenient*** For those running [Fedora Workstation](https://fedoraproject.org/workstation/) or [Fedora KDE Plasma Desktop](https://fedoraproject.org/spins/kde), and want to keep their host system clean.
141143
- *Optionally* toolbox packages are available: [Arch Linux](https://archlinux.org/), [Red Hat Enterprise Linux >= 8.5](https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux), or [Ubuntu](https://ubuntu.com/download)
142144
143145

0 commit comments

Comments
 (0)