Spaces:
Running
on
A100
Running
on
A100
check CUDA
Browse files
app.py
CHANGED
@@ -64,6 +64,32 @@ def images_to_video(images, output_path, fps=30):
|
|
64 |
# Configuration.
|
65 |
###############################################################################
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
config_path = 'configs/instant-mesh-large.yaml'
|
68 |
config = OmegaConf.load(config_path)
|
69 |
config_name = os.path.basename(config_path).replace('.yaml', '')
|
|
|
64 |
# Configuration.
|
65 |
###############################################################################
|
66 |
|
67 |
+
import shutil
|
68 |
+
|
69 |
+
def find_cuda():
|
70 |
+
# Check if CUDA_HOME or CUDA_PATH environment variables are set
|
71 |
+
cuda_home = os.environ.get('CUDA_HOME') or os.environ.get('CUDA_PATH')
|
72 |
+
|
73 |
+
if cuda_home and os.path.exists(cuda_home):
|
74 |
+
return cuda_home
|
75 |
+
|
76 |
+
# Search for the nvcc executable in the system's PATH
|
77 |
+
nvcc_path = shutil.which('nvcc')
|
78 |
+
|
79 |
+
if nvcc_path:
|
80 |
+
# Remove the 'bin/nvcc' part to get the CUDA installation path
|
81 |
+
cuda_path = os.path.dirname(os.path.dirname(nvcc_path))
|
82 |
+
return cuda_path
|
83 |
+
|
84 |
+
return None
|
85 |
+
|
86 |
+
cuda_path = find_cuda()
|
87 |
+
|
88 |
+
if cuda_path:
|
89 |
+
print(f"CUDA installation found at: {cuda_path}")
|
90 |
+
else:
|
91 |
+
print("CUDA installation not found")
|
92 |
+
|
93 |
config_path = 'configs/instant-mesh-large.yaml'
|
94 |
config = OmegaConf.load(config_path)
|
95 |
config_name = os.path.basename(config_path).replace('.yaml', '')
|