AshanGimhana commited on
Commit
1670712
·
verified ·
1 Parent(s): ed2a612

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -18
app.py CHANGED
@@ -6,24 +6,10 @@ os.system("pip install dlib==19.24.2")
6
 
7
  #############################################
8
 
9
- def install_cuda_toolkit():
10
- # CUDA_TOOLKIT_URL = "https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run"
11
- CUDA_TOOLKIT_URL = "https://developer.download.nvidia.com/compute/cuda/12.2.0/local_installers/cuda_12.2.0_535.54.03_linux.run"
12
- CUDA_TOOLKIT_FILE = "/tmp/%s" % os.path.basename(CUDA_TOOLKIT_URL)
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