TristonC edited a comment on issue #17855: TensorRT does not work on other GPUs 
except GPU0
   It seems the TRT setting the device properly. If you accept a dirty 
workaround try replace ctx = mx.gpu(1) with these: 
   from ctypes import cdll, c_char_p
   libcudart = cdll.LoadLibrary('')
   libcudart.cudaGetErrorString.restype = c_char_p
   def cudaSetDevice(device_idx):
       ret = libcudart.cudaSetDevice(device_idx)
       if ret != 0:
           error_string = libcudart.cudaGetErrorString(ret)
           raise RuntimeError("cudaSetDevice: " + error_string)
   device_id = 1
   ctx = mx.gpu(device_id)

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

Reply via email to