yejunliang23 commited on
Commit
24570e1
·
verified ·
1 Parent(s): ee6b48c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -1
app.py CHANGED
@@ -1,3 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
  import os
2
  import torch
3
  from threading import Thread
@@ -485,4 +497,5 @@ with gr.Blocks() as demo:
485
  show_progress=True)
486
 
487
 
488
- demo.launch()
 
 
1
+ import torch
2
+ import subprocess
3
+
4
+ print("torch.cuda.is_available():", torch.cuda.is_available())
5
+ try:
6
+ # 直接调用 nvidia-smi 查看驱动版本
7
+ nv_out = subprocess.check_output(["nvidia-smi", "--query-gpu=name,driver_version,cuda_version", "--format=csv,noheader"])
8
+ print(nv_out.decode("utf-8"))
9
+ except Exception as e:
10
+ print("nvidia-smi 无法执行或不存在:", e)
11
+
12
+ """
13
  import os
14
  import torch
15
  from threading import Thread
 
497
  show_progress=True)
498
 
499
 
500
+ demo.launch()
501
+ """