kaifz commited on
Commit
ffffc66
·
1 Parent(s): a5a92f8
Files changed (1) hide show
  1. app.py +20 -0
app.py CHANGED
@@ -14,6 +14,7 @@ import warp as wp
14
  import glob
15
  from torch.utils.data import DataLoader
16
  import os
 
17
  import time
18
  import cv2
19
  import copy
@@ -26,6 +27,25 @@ import spaces
26
  from spaces import zero
27
  zero.startup()
28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  gs_path = str(Path(__file__).parent / 'src/third-party/diff-gaussian-rasterization-w-depth')
30
  os.system(f'pip install -e {gs_path}')
31
  os.system('conda install -c dglteam/label/th24_cu124 dgl')
 
14
  import glob
15
  from torch.utils.data import DataLoader
16
  import os
17
+ import subprocess
18
  import time
19
  import cv2
20
  import copy
 
27
  from spaces import zero
28
  zero.startup()
29
 
30
+ def install_cuda_toolkit():
31
+ # CUDA_TOOLKIT_URL = "https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run"
32
+ # CUDA_TOOLKIT_URL = "https://developer.download.nvidia.com/compute/cuda/12.2.0/local_installers/cuda_12.2.0_535.54.03_linux.run"
33
+ CUDA_TOOLKIT_URL = "https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda_12.4.0_550.54.14_linux.run"
34
+ CUDA_TOOLKIT_FILE = "/tmp/%s" % os.path.basename(CUDA_TOOLKIT_URL)
35
+ subprocess.call(["wget", "-q", CUDA_TOOLKIT_URL, "-O", CUDA_TOOLKIT_FILE])
36
+ subprocess.call(["chmod", "+x", CUDA_TOOLKIT_FILE])
37
+ subprocess.call([CUDA_TOOLKIT_FILE, "--silent", "--toolkit"])
38
+
39
+ os.environ["CUDA_HOME"] = "/usr/local/cuda"
40
+ os.environ["PATH"] = "%s/bin:%s" % (os.environ["CUDA_HOME"], os.environ["PATH"])
41
+ os.environ["LD_LIBRARY_PATH"] = "%s/lib:%s" % (
42
+ os.environ["CUDA_HOME"],
43
+ "" if "LD_LIBRARY_PATH" not in os.environ else os.environ["LD_LIBRARY_PATH"],
44
+ )
45
+ # Fix: arch_list[-1] += '+PTX'; IndexError: list index out of range
46
+ os.environ["TORCH_CUDA_ARCH_LIST"] = "8.0;8.6"
47
+
48
+ install_cuda_toolkit()
49
  gs_path = str(Path(__file__).parent / 'src/third-party/diff-gaussian-rasterization-w-depth')
50
  os.system(f'pip install -e {gs_path}')
51
  os.system('conda install -c dglteam/label/th24_cu124 dgl')