mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-04-10 15:25:33 +00:00
[no-relnote] Use FilterForGPU to create all devchar symlinks
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
1cfaef4b01
commit
f3b730c805
@ -145,21 +145,9 @@ func (m allPossible) getGPUDeviceNodes(gpu int) []deviceNode {
|
|||||||
// getNVCapDeviceNodes generates a list of cap device nodes for a given GPU.
|
// getNVCapDeviceNodes generates a list of cap device nodes for a given GPU.
|
||||||
func (m allPossible) getNVCapDeviceNodes(gpu int) []deviceNode {
|
func (m allPossible) getNVCapDeviceNodes(gpu int) []deviceNode {
|
||||||
var selectedCapMinors []nvcaps.MigMinor
|
var selectedCapMinors []nvcaps.MigMinor
|
||||||
for gi := 0; ; gi++ {
|
|
||||||
giCap := nvcaps.NewGPUInstanceCap(gpu, gi)
|
for _, capMinors := range m.migCaps.FilterForGPU(nvcaps.Index(gpu)) {
|
||||||
giMinor, exist := m.migCaps[giCap]
|
selectedCapMinors = append(selectedCapMinors, capMinors)
|
||||||
if !exist {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
selectedCapMinors = append(selectedCapMinors, giMinor)
|
|
||||||
for ci := 0; ; ci++ {
|
|
||||||
ciCap := nvcaps.NewComputeInstanceCap(gpu, gi, ci)
|
|
||||||
ciMinor, exist := m.migCaps[ciCap]
|
|
||||||
if !exist {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
selectedCapMinors = append(selectedCapMinors, ciMinor)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var deviceNodes []deviceNode
|
var deviceNodes []deviceNode
|
||||||
|
Loading…
Reference in New Issue
Block a user