mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-22 08:18:32 +00:00
Include xorg discoverer with graphics mounts
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
9378d0cd0f
commit
b7e5cef934
@ -32,7 +32,7 @@ import (
|
|||||||
|
|
||||||
// NewGraphicsDiscoverer returns the discoverer for graphics tools such as Vulkan.
|
// NewGraphicsDiscoverer returns the discoverer for graphics tools such as Vulkan.
|
||||||
func NewGraphicsDiscoverer(logger *logrus.Logger, devices image.VisibleDevices, driverRoot string, nvidiaCTKPath string) (Discover, error) {
|
func NewGraphicsDiscoverer(logger *logrus.Logger, devices image.VisibleDevices, driverRoot string, nvidiaCTKPath string) (Discover, error) {
|
||||||
mounts, err := NewGraphicsMountsDiscoverer(logger, driverRoot)
|
mounts, err := NewGraphicsMountsDiscoverer(logger, driverRoot, nvidiaCTKPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to create mounts discoverer: %v", err)
|
return nil, fmt.Errorf("failed to create mounts discoverer: %v", err)
|
||||||
}
|
}
|
||||||
@ -44,19 +44,16 @@ func NewGraphicsDiscoverer(logger *logrus.Logger, devices image.VisibleDevices,
|
|||||||
|
|
||||||
drmByPathSymlinks := newCreateDRMByPathSymlinks(logger, drmDeviceNodes, driverRoot, nvidiaCTKPath)
|
drmByPathSymlinks := newCreateDRMByPathSymlinks(logger, drmDeviceNodes, driverRoot, nvidiaCTKPath)
|
||||||
|
|
||||||
xorg := optionalXorgDiscoverer(logger, driverRoot, nvidiaCTKPath)
|
|
||||||
|
|
||||||
discover := Merge(
|
discover := Merge(
|
||||||
Merge(drmDeviceNodes, drmByPathSymlinks),
|
Merge(drmDeviceNodes, drmByPathSymlinks),
|
||||||
mounts,
|
mounts,
|
||||||
xorg,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
return discover, nil
|
return discover, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewGraphicsMountsDiscoverer creates a discoverer for the mounts required by graphics tools such as vulkan.
|
// NewGraphicsMountsDiscoverer creates a discoverer for the mounts required by graphics tools such as vulkan.
|
||||||
func NewGraphicsMountsDiscoverer(logger *logrus.Logger, driverRoot string) (Discover, error) {
|
func NewGraphicsMountsDiscoverer(logger *logrus.Logger, driverRoot string, nvidiaCTKPath string) (Discover, error) {
|
||||||
locator, err := lookup.NewLibraryLocator(logger, driverRoot)
|
locator, err := lookup.NewLibraryLocator(logger, driverRoot)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to construct library locator: %v", err)
|
return nil, fmt.Errorf("failed to construct library locator: %v", err)
|
||||||
@ -87,9 +84,12 @@ func NewGraphicsMountsDiscoverer(logger *logrus.Logger, driverRoot string) (Disc
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
xorg := optionalXorgDiscoverer(logger, driverRoot, nvidiaCTKPath)
|
||||||
|
|
||||||
discover := Merge(
|
discover := Merge(
|
||||||
libraries,
|
libraries,
|
||||||
jsonMounts,
|
jsonMounts,
|
||||||
|
xorg,
|
||||||
)
|
)
|
||||||
|
|
||||||
return discover, nil
|
return discover, nil
|
||||||
|
@ -44,7 +44,7 @@ func newCommonNVMLDiscoverer(logger *logrus.Logger, driverRoot string, nvidiaCTK
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
graphicsMounts, err := discover.NewGraphicsMountsDiscoverer(logger, driverRoot)
|
graphicsMounts, err := discover.NewGraphicsMountsDiscoverer(logger, driverRoot, nvidiaCTKPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error constructing discoverer for graphics mounts: %v", err)
|
return nil, fmt.Errorf("error constructing discoverer for graphics mounts: %v", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user