We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4fc9cf6 commit fdf08afCopy full SHA for fdf08af
1 file changed
src/pb_memory.cc
@@ -295,11 +295,15 @@ PbMemory::GetGPUStartAddress()
295
{
296
if (memory_shm_ptr_->memory_type == TRITONSERVER_MEMORY_GPU) {
297
CUDAHandler& cuda_api = CUDAHandler::getInstance();
298
- CUdeviceptr start_address;
299
-
300
- cuda_api.PointerGetAttribute(
301
- &start_address, CU_POINTER_ATTRIBUTE_RANGE_START_ADDR,
302
- reinterpret_cast<CUdeviceptr>(data_ptr_));
+ CUdeviceptr start_address = 0;
+
+ // Skip this step for empty tensor as the CUDA API 'cuPointerGetAttribute'
+ // we use in this function does not accept nullptr.
+ if (data_ptr_) {
303
+ cuda_api.PointerGetAttribute(
304
+ &start_address, CU_POINTER_ATTRIBUTE_RANGE_START_ADDR,
305
+ reinterpret_cast<CUdeviceptr>(data_ptr_));
306
+ }
307
308
return reinterpret_cast<void*>(start_address);
309
}
0 commit comments