Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -16,6 +16,31 @@ from kiui.op import recenter
|
|
16 |
import kiui
|
17 |
from gradio_litmodel3d import LitModel3D
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
# we load the pre-trained model from HF
|
20 |
class LRMGeneratorWrapper:
|
21 |
def __init__(self):
|
|
|
16 |
import kiui
|
17 |
from gradio_litmodel3d import LitModel3D
|
18 |
|
19 |
+
|
20 |
+
def find_cuda():
|
21 |
+
# Check if CUDA_HOME or CUDA_PATH environment variables are set
|
22 |
+
cuda_home = os.environ.get('CUDA_HOME') or os.environ.get('CUDA_PATH')
|
23 |
+
|
24 |
+
if cuda_home and os.path.exists(cuda_home):
|
25 |
+
return cuda_home
|
26 |
+
|
27 |
+
# Search for the nvcc executable in the system's PATH
|
28 |
+
nvcc_path = shutil.which('nvcc')
|
29 |
+
|
30 |
+
if nvcc_path:
|
31 |
+
# Remove the 'bin/nvcc' part to get the CUDA installation path
|
32 |
+
cuda_path = os.path.dirname(os.path.dirname(nvcc_path))
|
33 |
+
return cuda_path
|
34 |
+
|
35 |
+
return None
|
36 |
+
|
37 |
+
cuda_path = find_cuda()
|
38 |
+
|
39 |
+
if cuda_path:
|
40 |
+
print(f"CUDA installation found at: {cuda_path}")
|
41 |
+
else:
|
42 |
+
print("CUDA installation not found")
|
43 |
+
|
44 |
# we load the pre-trained model from HF
|
45 |
class LRMGeneratorWrapper:
|
46 |
def __init__(self):
|