import torch

import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" # see issue #152
os.environ["CUDA_VISIBLE_DEVICES"]="4"

a = torch.zeros((1000,1000,1000)).cuda()
b = torch.zeros((1000,1000,1000)).cuda()

7b1607870175885b45f738c583897a830acb9589
<mask token>

<mask token>
os.environ['CUDA_DEVICE_ORDER'] = 'PCI_BUS_ID'
os.environ['CUDA_VISIBLE_DEVICES'] = '4'
a = torch.zeros((1000, 1000, 1000)).cuda()
b = torch.zeros((1000, 1000, 1000)).cuda()

import torch
import os
os.environ['CUDA_DEVICE_ORDER'] = 'PCI_BUS_ID'
os.environ['CUDA_VISIBLE_DEVICES'] = '4'
a = torch.zeros((1000, 1000, 1000)).cuda()
b = torch.zeros((1000, 1000, 1000)).cuda()

import torch

import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" # see issue #152
os.environ["CUDA_VISIBLE_DEVICES"]="4"

a = torch.zeros((1000,1000,1000)).cuda()
b = torch.zeros((1000,1000,1000)).cuda()
