Skip to content

Commit c3cfcbc

Browse files
authored
Bug fix: decode error_string if necessary. (#859)
Signed-off-by: SimengLiu-nv <simengl@nvidia.com>
1 parent 1da7332 commit c3cfcbc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

onnx_tensorrt/backend.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ def cudaSetDevice(device_idx):
1818
ret = libcudart.cudaSetDevice(device_idx)
1919
if ret != 0:
2020
error_string = libcudart.cudaGetErrorString(ret)
21+
if isinstance(error_string, bytes):
22+
error_string = error_string.decode("utf-8")
2123
raise RuntimeError("cudaSetDevice: " + error_string)
2224

2325
def count_trailing_ones(vals):

0 commit comments

Comments
 (0)