CogDL icon indicating copy to clipboard operation
CogDL copied to clipboard

无法在GPU上运行/Cannot run on GPU

Open FrancisGrace opened this issue 2 years ago • 2 comments

❓ Questions & Help

我的电脑有一个GPU,我在experiments()函数中指定了参数devices=[0],但运行后CPU利用率接近100%,GPU利用率几乎为0,显然程序并未在GPU上运行。 My computer has a GPU, and I declared the argument devices=[0] in the function experiments(). However, when I ran it, the utilization of CPU reached almost 100% while that of GPU was still almost 0%. Obviously the program didn't run on the GPU.

FrancisGrace avatar Sep 08 '22 15:09 FrancisGrace

Hi @FrancisGrace,

请问你是否成功安装了gpu版本的pytorch?可以通过输出torch.cuda.is_available()检查一下。

cenyk1230 avatar Sep 13 '22 09:09 cenyk1230

Hi @FrancisGrace,

请问你是否成功安装了gpu版本的pytorch?可以通过输出torch.cuda.is_available()检查一下。

@cenyk1230 是的,我的PyTorch版本为1.11,虚拟环境下这个函数返回值为True

FrancisGrace avatar Sep 13 '22 10:09 FrancisGrace