yslan commited on
Commit
97142d9
1 Parent(s): 4193d7b
Files changed (1) hide show
  1. app.py +21 -0
app.py CHANGED
@@ -1,4 +1,25 @@
1
  import os
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  os.system('pip install -e ./submodules/simple-knn')
3
  os.system('pip install -e ./submodules/diff-surfel-rasterization')
4
 
 
1
  import os
2
+ import subprocess
3
+
4
+ def install_cuda_toolkit():
5
+ # CUDA_TOOLKIT_URL = "https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run"
6
+ CUDA_TOOLKIT_URL = "https://developer.download.nvidia.com/compute/cuda/12.2.0/local_installers/cuda_12.2.0_535.54.03_linux.run"
7
+ CUDA_TOOLKIT_FILE = "/tmp/%s" % os.path.basename(CUDA_TOOLKIT_URL)
8
+ subprocess.call(["wget", "-q", CUDA_TOOLKIT_URL, "-O", CUDA_TOOLKIT_FILE])
9
+ subprocess.call(["chmod", "+x", CUDA_TOOLKIT_FILE])
10
+ subprocess.call([CUDA_TOOLKIT_FILE, "--silent", "--toolkit"])
11
+
12
+ os.environ["CUDA_HOME"] = "/usr/local/cuda"
13
+ os.environ["PATH"] = "%s/bin:%s" % (os.environ["CUDA_HOME"], os.environ["PATH"])
14
+ os.environ["LD_LIBRARY_PATH"] = "%s/lib:%s" % (
15
+ os.environ["CUDA_HOME"],
16
+ "" if "LD_LIBRARY_PATH" not in os.environ else os.environ["LD_LIBRARY_PATH"],
17
+ )
18
+ # Fix: arch_list[-1] += '+PTX'; IndexError: list index out of range
19
+ os.environ["TORCH_CUDA_ARCH_LIST"] = "8.0;8.6"
20
+
21
+ install_cuda_toolkit() # to compile the dependencies
22
+
23
  os.system('pip install -e ./submodules/simple-knn')
24
  os.system('pip install -e ./submodules/diff-surfel-rasterization')
25