mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
Add discovery of arch-specific vulkan ICD
On some RPM-based platforms, the path of the Vulkan ICD file include an architecture-specific infix to distinguish it from other architectures. (Most notably x86_64 vs i686). This change attempts to discover the arch-specific ICD file in addition to the standard nvidia_icd.json. Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
fdcd250362
commit
2de997e25b
@ -20,6 +20,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/NVIDIA/nvidia-container-toolkit/internal/config/image"
|
"github.com/NVIDIA/nvidia-container-toolkit/internal/config/image"
|
||||||
@ -81,14 +82,25 @@ func NewGraphicsMountsDiscoverer(logger logger.Interface, driver *root.Driver, h
|
|||||||
// vulkan ICD files are at {{ .driverRoot }}/vulkan instead of in /etc/vulkan.
|
// vulkan ICD files are at {{ .driverRoot }}/vulkan instead of in /etc/vulkan.
|
||||||
func newVulkanConfigsDiscover(logger logger.Interface, driver *root.Driver) Discover {
|
func newVulkanConfigsDiscover(logger logger.Interface, driver *root.Driver) Discover {
|
||||||
locator := lookup.First(driver.Configs(), driver.Files())
|
locator := lookup.First(driver.Configs(), driver.Files())
|
||||||
|
|
||||||
|
required := []string{
|
||||||
|
"vulkan/icd.d/nvidia_icd.json",
|
||||||
|
"vulkan/icd.d/nvidia_layers.json",
|
||||||
|
"vulkan/implicit_layer.d/nvidia_layers.json",
|
||||||
|
}
|
||||||
|
// For some RPM-based driver packages, the vulkan ICD files are installed to
|
||||||
|
// /usr/share/vulkan/icd.d/nvidia_icd.%{_target_cpu}.json
|
||||||
|
// We also include this in the list of candidates for the ICD file.
|
||||||
|
switch runtime.GOARCH {
|
||||||
|
case "amd64":
|
||||||
|
required = append(required, "vulkan/icd.d/nvidia_icd.x86_64.json")
|
||||||
|
case "arm64":
|
||||||
|
required = append(required, "vulkan/icd.d/nvidia_icd.aarch64.json")
|
||||||
|
}
|
||||||
return &mountsToContainerPath{
|
return &mountsToContainerPath{
|
||||||
logger: logger,
|
logger: logger,
|
||||||
locator: locator,
|
locator: locator,
|
||||||
required: []string{
|
required: required,
|
||||||
"vulkan/icd.d/nvidia_icd.json",
|
|
||||||
"vulkan/icd.d/nvidia_layers.json",
|
|
||||||
"vulkan/implicit_layer.d/nvidia_layers.json",
|
|
||||||
},
|
|
||||||
containerRoot: "/etc",
|
containerRoot: "/etc",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user