Update app.py
Browse files
app.py
CHANGED
@@ -340,9 +340,10 @@ def make_mesh(mesh_fpath, planes):
|
|
340 |
|
341 |
return mesh_fpath, mesh_glb_fpath
|
342 |
|
|
|
343 |
@spaces.GPU
|
344 |
def make3d(images):
|
345 |
-
|
346 |
|
347 |
cuda_path = find_cuda()
|
348 |
|
@@ -354,9 +355,10 @@ def make3d(images):
|
|
354 |
os.environ['PATH'] += ':/usr/local/cuda/bin'
|
355 |
os.environ['LD_LIBRARY_PATH'] += ':/usr/local/cuda/lib64'
|
356 |
|
357 |
-
|
358 |
print(f"CUDA_HOME:{os.environ.get('CUDA_HOME')}")
|
359 |
print(f"CUDA_HOME exist:{os.path.exists(os.environ.get('CUDA_HOME'))}")
|
|
|
360 |
global model
|
361 |
if IS_FLEXICUBES:
|
362 |
model.init_flexicubes_geometry(device, fovy=30.0, use_renderer=False)
|
|
|
340 |
|
341 |
return mesh_fpath, mesh_glb_fpath
|
342 |
|
343 |
+
install_cuda_toolkit()
|
344 |
@spaces.GPU
|
345 |
def make3d(images):
|
346 |
+
|
347 |
|
348 |
cuda_path = find_cuda()
|
349 |
|
|
|
355 |
os.environ['PATH'] += ':/usr/local/cuda/bin'
|
356 |
os.environ['LD_LIBRARY_PATH'] += ':/usr/local/cuda/lib64'
|
357 |
|
358 |
+
|
359 |
print(f"CUDA_HOME:{os.environ.get('CUDA_HOME')}")
|
360 |
print(f"CUDA_HOME exist:{os.path.exists(os.environ.get('CUDA_HOME'))}")
|
361 |
+
subprocess.run(['nvidia-smi']) # 测试 CUDA 是否可用
|
362 |
global model
|
363 |
if IS_FLEXICUBES:
|
364 |
model.init_flexicubes_geometry(device, fovy=30.0, use_renderer=False)
|