Hi,
When I call cuda(1) on a FloatTensor, this results in taking up memory on all available GPUs. I specify that the tensor should be created on the GPU 1 but this has no effect.
I ran the code:
import torch

if __name__ == '__main__':
    a = torch.FloatTensor(10, 20).cuda(1)

    print('Done!!!')

And the result of nvidin-smi is:
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1281      G   /usr/lib/xorg/Xorg                            37MiB |
|    0      1374      G   /usr/bin/gnome-shell                          49MiB |
|    0      2712      G   /usr/lib/xorg/Xorg                           317MiB |
|    0      2880      G   /usr/bin/gnome-shell                         235MiB |
|    0      2892      G   /opt/teamviewer/tv_bin/TeamViewer              2MiB |
|    0      3280      G   ...-token=00C0BADC3EA2964E642C4E1639C06C6D    80MiB |
|    0      3458      G   ...-token=0700AC55763E12A78BD21197AA676191   165MiB |
|    0      7932      C   ...n/.virtualenvs/torch_gpu_0.4/bin/python   549MiB |
|    1      7932      C   ...n/.virtualenvs/torch_gpu_0.4/bin/python   549MiB |
+-----------------------------------------------------------------------------+

Is this not the right way to select GPU? Also, if I specify CUDA_VISIBLE_DEVICES=1, then this works (I have to specify a GPU-id of 0, then).
Thanks,
Shirin