Fix for #127 - Use common dir for Nvidia Passthrough

This commit is contained in:
Darren Gibbard 2024-05-09 10:48:55 +01:00
parent 1108dbe5be
commit 26747088d5
1 changed files with 6 additions and 1 deletions

View File

@ -365,6 +365,8 @@ def passthrough_nvidia(
.decode() .decode()
.split("\n") .split("\n")
if x if x
# Strip individual modules for current kernel, since we add the whole directory later
and "/usr/lib/x86_64-linux-gnu/nvidia/current" not in x
] ]
) )
) )
@ -382,6 +384,9 @@ def passthrough_nvidia(
# while mounting the symlink will be resolved and nvidia-smi will appear as a regular file # while mounting the symlink will be resolved and nvidia-smi will appear as a regular file
nvidia_files.add("/usr/bin/nvidia-smi") nvidia_files.add("/usr/bin/nvidia-smi")
# Use common module dir
nvidia_files.add("/usr/lib/x86_64-linux-gnu/nvidia/current")
nvidia_mounts = [] nvidia_mounts = []
for file_path in nvidia_files: for file_path in nvidia_files:
@ -926,7 +931,7 @@ def get_zfs_dataset(path):
# Put back spaces which were encoded # Put back spaces which were encoded
# https://github.com/openzfs/zfs/issues/11182 # https://github.com/openzfs/zfs/issues/11182
return field.replace('\\040', ' ') return field.replace('\\040', ' ')
path = os.path.realpath(path) path = os.path.realpath(path)
with open("/proc/mounts", "r") as f: with open("/proc/mounts", "r") as f:
for line in f: for line in f: