Spaces:
Running
on
L40S
Running
on
L40S
Upload app_hg.py with huggingface_hub
Browse files
app_hg.py
CHANGED
@@ -52,8 +52,8 @@ from glob import glob
|
|
52 |
# check_env()
|
53 |
|
54 |
def install_cuda_toolkit():
|
55 |
-
CUDA_TOOLKIT_URL = "https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run"
|
56 |
-
|
57 |
CUDA_TOOLKIT_FILE = "/tmp/%s" % os.path.basename(CUDA_TOOLKIT_URL)
|
58 |
subprocess.call(["wget", "-q", CUDA_TOOLKIT_URL, "-O", CUDA_TOOLKIT_FILE])
|
59 |
subprocess.call(["chmod", "+x", CUDA_TOOLKIT_FILE])
|
@@ -67,9 +67,12 @@ def install_cuda_toolkit():
|
|
67 |
)
|
68 |
# Fix: arch_list[-1] += '+PTX'; IndexError: list index out of range
|
69 |
os.environ["TORCH_CUDA_ARCH_LIST"] = "8.0;8.6"
|
70 |
-
|
71 |
-
|
72 |
-
|
|
|
|
|
|
|
73 |
|
74 |
install_cuda_toolkit()
|
75 |
|
|
|
52 |
# check_env()
|
53 |
|
54 |
def install_cuda_toolkit():
|
55 |
+
# CUDA_TOOLKIT_URL = "https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run"
|
56 |
+
CUDA_TOOLKIT_URL = "https://developer.download.nvidia.com/compute/cuda/12.2.0/local_installers/cuda_12.2.0_535.54.03_linux.run"
|
57 |
CUDA_TOOLKIT_FILE = "/tmp/%s" % os.path.basename(CUDA_TOOLKIT_URL)
|
58 |
subprocess.call(["wget", "-q", CUDA_TOOLKIT_URL, "-O", CUDA_TOOLKIT_FILE])
|
59 |
subprocess.call(["chmod", "+x", CUDA_TOOLKIT_FILE])
|
|
|
67 |
)
|
68 |
# Fix: arch_list[-1] += '+PTX'; IndexError: list index out of range
|
69 |
os.environ["TORCH_CUDA_ARCH_LIST"] = "8.0;8.6"
|
70 |
+
try:
|
71 |
+
subprocess.check_call([sys.executable, "-m", "pip", "install", "git+https://github.com/facebookresearch/pytorch3d@stable"])
|
72 |
+
import pytorch3d
|
73 |
+
except Exception as err:
|
74 |
+
print(err)
|
75 |
+
print("new inner cuda install pytorch3d fail")
|
76 |
|
77 |
install_cuda_toolkit()
|
78 |
|