From b7e5cef9342d940520f94200a784f18c474f5c8e Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Wed, 10 May 2023 16:53:10 +0200 Subject: [PATCH] Include xorg discoverer with graphics mounts Signed-off-by: Evan Lezar --- internal/discover/graphics.go | 10 +++++----- pkg/nvcdi/common-nvml.go | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/discover/graphics.go b/internal/discover/graphics.go index 527f7c1d..3b9c9600 100644 --- a/internal/discover/graphics.go +++ b/internal/discover/graphics.go @@ -32,7 +32,7 @@ import ( // NewGraphicsDiscoverer returns the discoverer for graphics tools such as Vulkan. 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 { 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) - xorg := optionalXorgDiscoverer(logger, driverRoot, nvidiaCTKPath) - discover := Merge( Merge(drmDeviceNodes, drmByPathSymlinks), mounts, - xorg, ) return discover, nil } // 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) if err != nil { 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( libraries, jsonMounts, + xorg, ) return discover, nil diff --git a/pkg/nvcdi/common-nvml.go b/pkg/nvcdi/common-nvml.go index df81fc29..88ebec7d 100644 --- a/pkg/nvcdi/common-nvml.go +++ b/pkg/nvcdi/common-nvml.go @@ -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 { return nil, fmt.Errorf("error constructing discoverer for graphics mounts: %v", err) }