Merge branch 'main' into develop

This commit is contained in:
Jip-Hop 2023-02-28 20:57:33 +01:00
commit 25694734a4
1 changed files with 6 additions and 3 deletions

View File

@ -154,7 +154,7 @@ def start_jail(jail_name):
systemd_nspawn_additional_args.append('--bind=/dev/dri')
# Detect nvidia GPU
if os.path.exists('/dev/nvidia'):
if os.path.exists('/dev/nvidia0'):
nvidia_driver_files = []
try:
@ -166,12 +166,15 @@ def start_jail(jail_name):
Unable to mount the nvidia driver files."""))
for file_path in nvidia_driver_files:
if file_path.startswith('/dev/'):
if not file_path:
# Skip empty strings
continue
elif file_path.startswith('/dev/'):
systemd_nspawn_additional_args.append(
f"--bind={file_path}")
else:
systemd_nspawn_additional_args.append(
f"--bind-ro=={file_path}")
f"--bind-ro={file_path}")
cmd = ['systemd-run',
*shlex.split(config.get('systemd_run_default_args', '')),