Repository: pytorch
Issue: `mem_get_info` reserves memory and can not be destroyed / deallocated. 
Labels: module: cuda,triaged

### 🐛 Describe the bug

When running mem_get_info it reserves memory and can not be destroyed. Especially if running multi-processing, the memory is allocated for every process. Probably it is related to nvidia C function `cudaMemGetInfo`. It is suggested that `cudaDeviceReset` is run after to deallocate the memory, but no such binding exists in pytorch c binding library. 

https://stackoverflow.com/questions/64854862/free-memory-occupied-by-cudamemgetinfo


### Minimal working example:

```python
import torch
print(torch.cuda.list_gpu_processes())
torch.cuda.mem_get_info(0)
print(torch.cuda.list_gpu_processes())
print(torch.cuda.empty_cache())
print(torch.cuda.list_gpu_processes())
```

### Output:
```
GPU:0
no processes are running
GPU:0
process     120408 uses      843.000 MB GPU memory
GPU:0
process     120408 uses      843.000 MB GPU memory
```

### Expected Output:
```
GPU:0
no processes are running
GPU:0
no processes are running
GPU:0
no processes are running
```


### Versions

Collecting environment information...
PyTorch version: 1.12.1
Is debug build: False
CUDA used to build PyTorch: 11.3
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.4 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.31

Python version: 3.9.12 (main, Jun  1 2022, 11:38:51)  [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-5.15.0-1018-gcp-x86_64-with-glibc2.31
Is CUDA available: True
CUDA runtime version: Could not collect
GPU models and configuration: 
GPU 0: NVIDIA A100-SXM4-40GB
GPU 1: NVIDIA A100-SXM4-40GB
GPU 2: NVIDIA A100-SXM4-40GB
GPU 3: NVIDIA A100-SXM4-40GB
GPU 4: NVIDIA A100-SXM4-40GB
GPU 5: NVIDIA A100-SXM4-40GB
GPU 6: NVIDIA A100-SXM4-40GB
GPU 7: NVIDIA A100-SXM4-40GB

Nvidia driver version: 495.46
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] mypy==0.982
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.23.1
[pip3] torch==1.12.1
[pip3] torch-fidelity==0.3.0
[pip3] torchaudio==0.12.1
[pip3] torchvision==0.13.1
[conda] blas                      1.0                         mkl  
[conda] cudatoolkit               11.3.1               h2bc3f7f_2  
[conda] ffmpeg                    4.3                  hf484d3e_0    pytorch
[conda] mkl                       2021.4.0           h06a4308_640  
[conda] mkl-service               2.4.0            py39h7f8727e_0  
[conda] mkl_fft                   1.3.1            py39hd3c417c_0  
[conda] mkl_random                1.2.2            py39h51133e4_0  
[conda] numpy                     1.23.1           py39h6c91a56_0  
[conda] numpy-base                1.23.1           py39ha15fc14_0  
[conda] pytorch                   1.12.1          py3.9_cuda11.3_cudnn8.3.2_0    pytorch
[conda] pytorch-mutex             1.0                        cuda    pytorch
[conda] torch-fidelity            0.3.0                    pypi_0    pypi
[conda] torchaudio                0.12.1               py39_cu113    pytorch
[conda] torchvision               0.13.1               py39_cu113    pytorch

cc @ngimel