Just ask for GPU passthrough

This commit is contained in:
Jip-Hop 2024-01-27 04:23:46 +01:00
parent bf54fea9a1
commit ae23b13301
1 changed files with 7 additions and 21 deletions

View File

@ -720,29 +720,15 @@ def create_jail(jail_name, distro="debian", release="bookworm"):
gpu_passthrough_intel = 0
if os.path.exists("/dev/dri"):
print("Detected the presence of an intel GPU.\n")
if agree("Passthrough the intel GPU?", "n"):
gpu_passthrough_intel = 1
if agree("Passthrough the intel GPU (if present)?", "n"):
gpu_passthrough_intel = 1
print()
gpu_passthrough_nvidia = 0
if (
subprocess.run(
["modprobe", "nvidia-current-uvm"],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
).returncode
== 0
):
nvidia_detected = True
else:
nvidia_detected = False
if nvidia_detected:
print("Detected the presence of an nvidia GPU.\n")
if agree("Passthrough the nvidia GPU?", "n"):
gpu_passthrough_nvidia = 1
if agree("Passthrough the nvidia GPU (if present)?", "n"):
gpu_passthrough_nvidia = 1
print(
dedent(