Skip to content

Update Symlink evaluation for NVIDIA-SMI #2506

@JunAr7112

Description

@JunAr7112

This issue was created as a followup to this discussion.

In some systems, there could be a symlink on the nvidia-smi path (for example: /usr/sbin/nvidia-smi) which could cause an error for our validation functions. Earlier we updated the validation to resolve host nvidia-smi for symlinks wrt /usr/bin/nvidia-smi using pathrs (see the function below):

func resolveHostNvidiaSMI(hostRootCtrPath string) (os.FileInfo, error) {
	f, err := pathrs.OpenInRoot(hostRootCtrPath, "/usr/bin/nvidia-smi")
	if err != nil {
		return nil, fmt.Errorf("failed to open 'nvidia-smi' on the host: %w", err)
	}
	defer f.Close()

	fileInfo, err := f.Stat()
	if err != nil {
		return nil, fmt.Errorf("failed to stat 'nvidia-smi' on the host: %w", err)
	}

	return fileInfo, nil
}

...However, ideally we would like a more general solution for symlinks in other paths like /usr/sbin/nvidia-smi and /usr/lib/wsl/lib/nvidia-smi.

Metadata

Metadata

Assignees

Labels

featureissue/PR that proposes a new feature or functionalitylifecycle/frozenneeds-triageissue or PR has not been assigned a priority-px label

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions