mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-25 13:35:00 +00:00
Use devRoot to resolve MIG device nodes
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
9396858834
commit
21fc1f24e4
@ -6,6 +6,7 @@
|
|||||||
* Log explicitly requested runtime mode.
|
* Log explicitly requested runtime mode.
|
||||||
* Remove package dependency on libseccomp.
|
* Remove package dependency on libseccomp.
|
||||||
* Added detection of libnvdxgdmal.so.1 on WSL2
|
* Added detection of libnvdxgdmal.so.1 on WSL2
|
||||||
|
* Use devRoot to resolve MIG device nodes.
|
||||||
|
|
||||||
## v1.15.0-rc.1
|
## v1.15.0-rc.1
|
||||||
* Skip update of ldcache in containers without ldconfig. The .so.SONAME symlinks are still created.
|
* Skip update of ldcache in containers without ldconfig. The .so.SONAME symlinks are still created.
|
||||||
|
@ -67,7 +67,7 @@ func (l *nvmllib) GetMIGDeviceEdits(parent device.Device, mig device.MigDevice)
|
|||||||
return nil, fmt.Errorf("error getting Compute Instance ID: %v", ret)
|
return nil, fmt.Errorf("error getting Compute Instance ID: %v", ret)
|
||||||
}
|
}
|
||||||
|
|
||||||
editsForDevice, err := GetEditsForComputeInstance(l.logger, l.driverRoot, gpu, gi, ci)
|
editsForDevice, err := l.GetEditsForComputeInstance(gpu, gi, ci)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to create container edits for MIG device: %v", err)
|
return nil, fmt.Errorf("failed to create container edits for MIG device: %v", err)
|
||||||
}
|
}
|
||||||
@ -76,8 +76,8 @@ func (l *nvmllib) GetMIGDeviceEdits(parent device.Device, mig device.MigDevice)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetEditsForComputeInstance returns the CDI edits for a particular compute instance defined by the (gpu, gi, ci) tuple
|
// GetEditsForComputeInstance returns the CDI edits for a particular compute instance defined by the (gpu, gi, ci) tuple
|
||||||
func GetEditsForComputeInstance(logger logger.Interface, driverRoot string, gpu int, gi int, ci int) (*cdi.ContainerEdits, error) {
|
func (l *nvmllib) GetEditsForComputeInstance(gpu int, gi int, ci int) (*cdi.ContainerEdits, error) {
|
||||||
computeInstance, err := newComputeInstanceDiscoverer(logger, driverRoot, gpu, gi, ci)
|
computeInstance, err := newComputeInstanceDiscoverer(l.logger, l.devRoot, gpu, gi, ci)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to create discoverer for Compute Instance: %v", err)
|
return nil, fmt.Errorf("failed to create discoverer for Compute Instance: %v", err)
|
||||||
}
|
}
|
||||||
@ -91,7 +91,7 @@ func GetEditsForComputeInstance(logger logger.Interface, driverRoot string, gpu
|
|||||||
}
|
}
|
||||||
|
|
||||||
// newComputeInstanceDiscoverer returns a discoverer for the specified compute instance
|
// newComputeInstanceDiscoverer returns a discoverer for the specified compute instance
|
||||||
func newComputeInstanceDiscoverer(logger logger.Interface, driverRoot string, gpu int, gi int, ci int) (discover.Discover, error) {
|
func newComputeInstanceDiscoverer(logger logger.Interface, devRoot string, gpu int, gi int, ci int) (discover.Discover, error) {
|
||||||
parentPath := fmt.Sprintf("/dev/nvidia%d", gpu)
|
parentPath := fmt.Sprintf("/dev/nvidia%d", gpu)
|
||||||
|
|
||||||
migCaps, err := nvcaps.NewMigCaps()
|
migCaps, err := nvcaps.NewMigCaps()
|
||||||
@ -113,7 +113,7 @@ func newComputeInstanceDiscoverer(logger logger.Interface, driverRoot string, gp
|
|||||||
|
|
||||||
deviceNodes := discover.NewCharDeviceDiscoverer(
|
deviceNodes := discover.NewCharDeviceDiscoverer(
|
||||||
logger,
|
logger,
|
||||||
driverRoot,
|
devRoot,
|
||||||
[]string{
|
[]string{
|
||||||
parentPath,
|
parentPath,
|
||||||
giCapDevicePath,
|
giCapDevicePath,
|
||||||
|
Loading…
Reference in New Issue
Block a user