From 9e6bd6df0195cfc4ca52fd99d271eb1b2c7fc1ce Mon Sep 17 00:00:00 2001 From: David Rohr Date: Mon, 7 Oct 2024 11:10:08 +0200 Subject: [PATCH] GPU: Add debug output --- GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.cu | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.cu b/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.cu index a51b3f9e2261f..11c40fed7b811 100644 --- a/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.cu +++ b/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.cu @@ -329,6 +329,9 @@ int GPUReconstructionCUDA::InitDevice_Runtime() mDeviceMemorySize = mDeviceMemorySize * 2 / 3; // Leave 1/3 of GPU memory for event display } + if (mProcessingSettings.debugLevel >= 3) { + GPUInfo("Allocating memory on GPU"); + } if (mDeviceMemorySize > deviceProp.totalGlobalMem || GPUFailedMsgI(cudaMalloc(&mDeviceMemoryBase, mDeviceMemorySize))) { size_t free, total; GPUFailedMsg(cudaMemGetInfo(&free, &total)); @@ -336,6 +339,9 @@ int GPUReconstructionCUDA::InitDevice_Runtime() GPUFailedMsgI(cudaDeviceReset()); return (1); } + if (mProcessingSettings.debugLevel >= 3) { + GPUInfo("Allocating memory on Host"); + } if (GPUFailedMsgI(cudaMallocHost(&mHostMemoryBase, mHostMemorySize))) { GPUError("Error allocating Page Locked Host Memory (trying %lld bytes)", (long long int)mHostMemorySize); GPUFailedMsgI(cudaDeviceReset()); @@ -611,6 +617,9 @@ int GPUReconstructionCUDA::GPUDebug(const char* state, int stream, bool force) int GPUReconstructionCUDA::registerMemoryForGPU_internal(const void* ptr, size_t size) { + if (mProcessingSettings.debugLevel >= 3) { + GPUInfo("Registering %zu bytes of memory for GPU", size); + } return GPUFailedMsgI(cudaHostRegister((void*)ptr, size, cudaHostRegisterDefault)); }