AshanGimhana
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -6,24 +6,10 @@ os.system("pip install dlib==19.24.2")
|
|
6 |
|
7 |
#############################################
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
subprocess.call(["wget", "-q", CUDA_TOOLKIT_URL, "-O", CUDA_TOOLKIT_FILE])
|
14 |
-
subprocess.call(["chmod", "+x", CUDA_TOOLKIT_FILE])
|
15 |
-
subprocess.call([CUDA_TOOLKIT_FILE, "--silent", "--toolkit"])
|
16 |
-
|
17 |
-
os.environ["CUDA_HOME"] = "/usr/local/cuda"
|
18 |
-
os.environ["PATH"] = "%s/bin:%s" % (os.environ["CUDA_HOME"], os.environ["PATH"])
|
19 |
-
os.environ["LD_LIBRARY_PATH"] = "%s/lib:%s" % (
|
20 |
-
os.environ["CUDA_HOME"],
|
21 |
-
"" if "LD_LIBRARY_PATH" not in os.environ else os.environ["LD_LIBRARY_PATH"],
|
22 |
-
)
|
23 |
-
# Fix: arch_list[-1] += '+PTX'; IndexError: list index out of range
|
24 |
-
os.environ["TORCH_CUDA_ARCH_LIST"] = "8.0;8.6"
|
25 |
-
|
26 |
-
install_cuda_toolkit()
|
27 |
|
28 |
###################################################
|
29 |
|
|
|
6 |
|
7 |
#############################################
|
8 |
|
9 |
+
import torch
|
10 |
+
print(f"Is CUDA available: {torch.cuda.is_available()}")
|
11 |
+
# True
|
12 |
+
print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
###################################################
|
15 |
|