train_env_prepare/check_core_cuda.sh

11 lines
363 B
Bash

python - <<'PY'
import torch
print("PyTorch 版本:", torch.__version__)
print("CUDA runtime 版本:", torch.version.cuda)
print("GPU 可用:", torch.cuda.is_available())
if torch.cuda.is_available():
print("GPU 数量:", torch.cuda.device_count())
for i in range(torch.cuda.device_count()):
print(f" GPU {i}:", torch.cuda.get_device_name(i))
PY