containers / containers/toolbox
Toolbox Run failed to get Container Device Interface containerEdits for NVIDIA
- Dominant language
- Go
- Stars
- 3.5k
- Forks
- 262
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 1
Description
**Describe the bug**
The command `toolbox run` fails with "Error: failed to get Container Device Interface containerEdits for NVIDIA".
```
$ toolbox run ls
...
level=debug msg="Generating Container Device Interface for NVIDIA: failed to get containerEdits: failed to create
discoverer for common entities: failed to create discoverer for driver files: failed to create discoverer for driver libraries: failed to get libraries for driver version: failed to locate libcuda.so.575.57.08: pattern libcuda.so.575.57.08 not found\nlibcuda.so.575.57.08: not found"
Error: failed to get Container Device Interface containerEdits for NVIDIA
```
My system has nvidia kernel drivers loaded:
```
$ lsmod | grep nvidia
nvidia_uvm 4218880 4
nvidia_drm 159744 5
nvidia_modeset 2150400 1 nvidia_drm
nvidia 12976128 9 nvidia_uvm,nvidia_modeset
drm_ttm_helper 16384 2 nvidia_drm,xe
video 81920 4 asus_wmi,xe,i915,nvidia_modeset
```
But CUDA libraries **are NOT** installed.
**Steps how to reproduce the behaviour**
1. Load nvidia kernel drivers
2. Make sure not to have CUDA libraries installed
3. Run a `toolbox run` command
4. See error
**Expected behaviour**
The `toolbox run` command is expected to be executed regularly.
**Actual behaviour**
The command `toolbox run` fails with "Error: failed to get Container Device Interface containerEdits for NVIDIA"
**Output of `toolbox --version` (v0.0.90+)**
toolbox version 0.1.2
**Toolbx package info (`rpm -q toolbox`)**
toolbox-0.1.2-1.fc42.x86_64
**Output of `podman version`**
e.g.,
```
Client: Podman Engine
Version: 5.5.2
API Version: 5.5.2
Go Version: go1.24.4
Git Commit: e7d8226745ba07a64b7176a7f128e4ef53225a0e
Built: Tue Jun 24 02:00:00 2025
Build Origin: Fedora Project
OS/Arch: linux/amd64
```
**Podman package info (`rpm -q podman`)**
podman-5.5.2-1.fc42.x86_64
**Info about your OS**
Fedora Linux 42 (Workstation Edition)
**Additional context**
Note that `toolbox create`, `toolbox enter`, etc. all works perfectly fine.
A possible fix would be failing with an `ErrPlatformUnsupported` in `GenerateCDISpec` when CUDA libraries are not found in the host system so that the error is managed gracefully.
```
diff --git a/src/pkg/nvidia/nvidia.go b/src/pkg/nvidia/nvidia.go
index c2cfe19..5593d5b 100644
--- a/src/pkg/nvidia/nvidia.go
+++ b/src/pkg/nvidia/nvidia.go
@@ -108,7 +108,7 @@ func GenerateCDISpec() (*specs.Spec, error) {
commonEdits, err := cdi.GetCommonEdits()
if err != nil {
logrus.Debugf("Generating Container Device Interface for NVIDIA: failed to get containerEdits: %s", err)
- return nil, errors.New("failed to get Container Device Interface containerEdits for NVIDIA")
+ return nil, ErrPlatformUnsupported
}
spec, err := nvspec.New(nvspec.WithEdits(*commonEdits.ContainerEdits))
```
Contributor guide
Research direction
Start in src/pkg/nvidia/nvidia.go at GenerateCDISpec and inspect how missing CUDA libraries are reported when toolbox run generates NVIDIA CDI edits. Reproduce on a host with NVIDIA kernel drivers but no CUDA libraries, then run the relevant Go tests; done means toolbox run proceeds normally and the unsupported-platform case is handled without the current fatal error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100