diff --git a/pkg/parse/parse_unix.go b/pkg/parse/parse_unix.go index ebb8ad49184..220bb1f7dba 100644 --- a/pkg/parse/parse_unix.go +++ b/pkg/parse/parse_unix.go @@ -7,6 +7,7 @@ import ( "fmt" "os" "path/filepath" + "strings" "github.com/containers/buildah/define" "github.com/opencontainers/runc/libcontainer/devices" @@ -18,6 +19,13 @@ func DeviceFromPath(device string) (define.ContainerDevices, error) { if err != nil { return nil, err } + + if strings.HasPrefix(src, "nvidia.com") { + device := define.BuildahDevice{Source: src, Destination: dst} + devs = append(devs, device) + return devs, nil + } + if linkTarget, err := os.Readlink(src); err == nil { if filepath.IsAbs(linkTarget) { src = linkTarget