drewThomasson
commited on
Commit
•
e19ca69
1
Parent(s):
a293829
trying to fix
Browse files
app.py
CHANGED
@@ -34,9 +34,15 @@ def install_cuda_if_gpu_detected():
|
|
34 |
if torch.cuda.is_available():
|
35 |
print("GPU detected! Proceeding with installation...")
|
36 |
try:
|
|
|
|
|
|
|
|
|
37 |
# Add NVIDIA's package repositories
|
38 |
subprocess.run(['apt-key', 'adv', '--fetch-keys', 'https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/3bf863cc.pub'], check=True)
|
39 |
subprocess.run(['add-apt-repository', 'deb https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/ /'], check=True)
|
|
|
|
|
40 |
subprocess.run(['apt-get', 'update'], check=True)
|
41 |
|
42 |
# Install CUDA dependencies
|
@@ -49,6 +55,7 @@ def install_cuda_if_gpu_detected():
|
|
49 |
print("No GPU detected. Skipping installation.")
|
50 |
|
51 |
|
|
|
52 |
# Run the function
|
53 |
install_cuda_if_gpu_detected()
|
54 |
|
|
|
34 |
if torch.cuda.is_available():
|
35 |
print("GPU detected! Proceeding with installation...")
|
36 |
try:
|
37 |
+
# Update package list and install necessary packages
|
38 |
+
subprocess.run(['apt-get', 'update'], check=True)
|
39 |
+
subprocess.run(['apt-get', 'install', '-y', 'software-properties-common'], check=True)
|
40 |
+
|
41 |
# Add NVIDIA's package repositories
|
42 |
subprocess.run(['apt-key', 'adv', '--fetch-keys', 'https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/3bf863cc.pub'], check=True)
|
43 |
subprocess.run(['add-apt-repository', 'deb https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/ /'], check=True)
|
44 |
+
|
45 |
+
# Update package list again
|
46 |
subprocess.run(['apt-get', 'update'], check=True)
|
47 |
|
48 |
# Install CUDA dependencies
|
|
|
55 |
print("No GPU detected. Skipping installation.")
|
56 |
|
57 |
|
58 |
+
|
59 |
# Run the function
|
60 |
install_cuda_if_gpu_detected()
|
61 |
|