From 1ee64b0c3685aa6f24b6d3221b7d4df386ef7307 Mon Sep 17 00:00:00 2001 From: paxflsu4r <198028451@qq.com> Date: Mon, 20 Jan 2025 16:51:46 +0800 Subject: [PATCH] ADD file via upload --- cudaTest.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 cudaTest.py diff --git a/cudaTest.py b/cudaTest.py new file mode 100644 index 0000000..129ffbf --- /dev/null +++ b/cudaTest.py @@ -0,0 +1,10 @@ +import torch +import sys +if torch.cuda.is_available(): + # 获取可用的GPU数量 + num_gpus = torch.cuda.device_count() + print(f'可用的GPU数量: {num_gpus}') +else: + print('当前系统没有CUDA支持的GPU') +print(torch.version.cuda) +print("Python version:", sys.version) \ No newline at end of file