更新readme和启动提示

This commit is contained in:
yuruo 2025-03-04 12:48:19 +08:00
parent b3d66c669c
commit ce8d7cb6b3
2 changed files with 20 additions and 0 deletions

View File

@ -29,6 +29,17 @@ python main.py
## 问题
可以通过`pip list`查看pytorch版本然后从[官网]([官网](https://pytorch.org/get-started/locally/)查看支持的cuda版本。如果cuda不匹配就无法使用GPU这会导致运行过程非常卡。比如如果`pip list`查看的 torch 版本为 2.6.0那么它只支持cuda版本为11.8、12.4和12.6请升级或者降级你的cuda版本到这几个版本。
如果启动时报“显卡驱动不适配请根据readme安装合适版本的 torch”。那么你需要
1. 卸载当前PyTorch版本
```shell
pip uninstall torch torchvision torchaudio
```
2. 安装支持CUDA 12.6你自己的cuda版本的PyTorch版本访问PyTorch官网(https://pytorch.org/get-started/locally/)
然后复制网站生成的安装命令,类似于:
```bash
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126
```
## 🤝 参与共建
请参考[贡献指南](https://s0soyusc93k.feishu.cn/wiki/ZE7KwtRweicLbNkHSdMcBMTxngg?from=from_copylink).

View File

@ -5,7 +5,15 @@ import sys
from gradio_ui import app
from util import download_weights
import time
import torch
def run():
try:
print(torch.cuda.is_available()) # 应该返回True
print(torch.cuda.device_count()) # 应该至少返回1
print(torch.cuda.get_device_name(0)) # 应该显示您的GPU名称
except Exception:
print("显卡驱动不适配请根据readme安装合适版本的 torch")
# 启动 server.py 子进程,并捕获其输出
server_process = subprocess.Popen(
["python", "./server.py"],
@ -18,6 +26,7 @@ def run():
try:
# 下载权重文件
download_weights.download()
print("启动Omniserver服务中约20s左右请耐心等待")
# 启动 Gradio UI
# 等待 server_process 打印出 "Started server process"
while True: