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