torch.cuda.memory_reserved returns 0 eventhough RAM is used

Viewed 131

Hi I am trying to determine if a GPU has already allocated some memory with the following commands:

torch.cuda.memory_reserved('cuda:0')
torch.cuda.memory_reserved(0)
torch.cuda.memory_allocated('cuda:0')
torch.cuda.memory_allocated(0)

They all return 0. Even though nvidia-smi clearly shows running processes (from other users and myself) which consume GPU-RAM.

What am I doing wrong? And how can I further debug this issue?


My system:

nvidia-smi output

$nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Tue_Mar__8_18:18:20_PST_2022
Cuda compilation tools, release 11.6, V11.6.124
Build cuda_11.6.r11.6/compiler.31057947_0

pytorch version 1.10.0

0 Answers
Related