Skip to content

Commit

Permalink
Bug fix: decode error_string if necessary. (#859)
Browse files Browse the repository at this point in the history
Signed-off-by: SimengLiu-nv <[email protected]>
  • Loading branch information
SimengLiu-nv committed Jul 25, 2022
1 parent 1da7332 commit c3cfcbc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions onnx_tensorrt/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ def cudaSetDevice(device_idx):
ret = libcudart.cudaSetDevice(device_idx)
if ret != 0:
error_string = libcudart.cudaGetErrorString(ret)
if isinstance(error_string, bytes):
error_string = error_string.decode("utf-8")
raise RuntimeError("cudaSetDevice: " + error_string)

def count_trailing_ones(vals):
Expand Down

0 comments on commit c3cfcbc

Please sign in to comment.