From b30915e161b7e7f6ed47fd04ec9fed6538870cc8 Mon Sep 17 00:00:00 2001 From: BLACKBOX Agent Date: Fri, 7 Nov 2025 07:24:48 +0000 Subject: [PATCH] fix(onnx): handle tuple return from CUDA runtime functions --- quickstart/IntroNotebooks/onnx_helper.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/quickstart/IntroNotebooks/onnx_helper.py b/quickstart/IntroNotebooks/onnx_helper.py index afa950cc..0baca23d 100644 --- a/quickstart/IntroNotebooks/onnx_helper.py +++ b/quickstart/IntroNotebooks/onnx_helper.py @@ -85,7 +85,7 @@ def predict(self, batch): # result gets copied into output # transfer input data to device err = cudart.cudaMemcpyAsync( self.d_input, batch.ctypes.data, batch.nbytes, cudart.cudaMemcpyKind.cudaMemcpyHostToDevice, self.stream - ) + )[0] if err != cudart.cudaError_t.cudaSuccess: raise RuntimeError(f"Failed to copy input to device: {cudart.cudaGetErrorString(err)}") @@ -99,12 +99,12 @@ def predict(self, batch): # result gets copied into output self.output.nbytes, cudart.cudaMemcpyKind.cudaMemcpyDeviceToHost, self.stream, - ) + )[0] if err != cudart.cudaError_t.cudaSuccess: raise RuntimeError(f"Failed to copy output from device: {cudart.cudaGetErrorString(err)}") # synchronize threads - err = cudart.cudaStreamSynchronize(self.stream) + err = cudart.cudaStreamSynchronize(self.stream)[0] if err != cudart.cudaError_t.cudaSuccess: raise RuntimeError(f"Failed to synchronize stream: {cudart.cudaGetErrorString(err)}")