aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniAndTheWeb <57776841+DaniAndTheWeb@users.noreply.github.com>2023-01-14 14:43:29 +0000
committerGitHub <noreply@github.com>2023-01-14 14:43:29 +0000
commit934cba0f4ca3e80a2079a657ebb6ca8c1ee2d10b (patch)
tree9dfd9e8b6f94956af7c4ccaafc188caf35f715c1
parent54fa77facc1849fbbfe61c1ca6d99b117d609d67 (diff)
downloadstable-diffusion-webui-gfx803-934cba0f4ca3e80a2079a657ebb6ca8c1ee2d10b.tar.gz
stable-diffusion-webui-gfx803-934cba0f4ca3e80a2079a657ebb6ca8c1ee2d10b.tar.bz2
stable-diffusion-webui-gfx803-934cba0f4ca3e80a2079a657ebb6ca8c1ee2d10b.zip
Delete detection.py
-rw-r--r--detection.py47
1 files changed, 0 insertions, 47 deletions
diff --git a/detection.py b/detection.py
deleted file mode 100644
index 442c4be5..00000000
--- a/detection.py
+++ /dev/null
@@ -1,47 +0,0 @@
-# This script detects which GPU is currently used in Windows and Linux
-import os
-import sys
-
-def check_gpu():
- # First, check if the `lspci` command is available
- if not os.system("which lspci > /dev/null") == 0:
- # If the `lspci` command is not available, try the `dxdiag` command on Windows
- if os.name == "nt":
- # On Windows, run the `dxdiag` command and check the output for the "Card name" field
- # Create the dxdiag.txt file
- os.system("dxdiag /t dxdiag.txt")
-
- # Read the dxdiag.txt file
- with open("dxdiag.txt", "r") as f:
- output = f.read()
-
- if "Card name" in output:
- card_name_start = output.index("Card name: ") + len("Card name: ")
- card_name_end = output.index("\n", card_name_start)
- card_name = output[card_name_start:card_name_end]
- else:
- card_name = "Unknown"
- print(f"Card name: {card_name}")
- os.remove("dxdiag.txt")
- if "AMD" in card_name:
- return "AMD"
- elif "Intel" in card_name:
- return "Intel"
- elif "NVIDIA" in card_name:
- return "NVIDIA"
- else:
- return "Unknown"
- else:
- return "Unknown"
- else:
- # If the `lspci` command is available, use it to get the GPU vendor and model information
- output = os.popen("lspci | grep -i vga").read()
- if "AMD" in output:
- return "AMD"
- elif "Intel" in output:
- return "Intel"
- elif "NVIDIA" in output:
- return "NVIDIA"
- else:
- return "Unknown"
-