I have the following error was wondering How can I get around torch.cuda.device(gpu_id):
.
gpu_id is set at 0 or 1
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-11-d5325e6198b5> in <module>()
176
177 if __name__ == '__main__':
--> 178 train()
<ipython-input-11-d5325e6198b5> in train()
84 validloader = DataLoader(valid_dataset, batch_size=32, shuffle=False, num_workers=2)
85
---> 86 with torch.cuda.device(gpu_id):
87 model = UNetResNet(34, dropout_2d=0.2).cuda()
88 optimizer = torch.optim.Adam(model.parameters(), lr=1e-4, weight_decay=1e-4)
/usr/local/lib/python3.6/site-packages/torch/cuda/__init__.py in __enter__(self)
205 if self.idx is -1:
206 return
--> 207 self.prev_idx = torch._C._cuda_getDevice()
208 if self.prev_idx != self.idx:
209 torch._C._cuda_setDevice(self.idx)
RuntimeError: cuda runtime error (35) : CUDA driver version is insufficient for CUDA runtime version at torch/csrc/cuda/Module.cpp:107