There was an error while loading. Please reload this page.
1 parent a9435f7 commit deb0a78Copy full SHA for deb0a78
7 files changed
GPU/GPUTracking/Base/GPUReconstruction.cxx
@@ -120,9 +120,18 @@ int GPUReconstruction::Init()
120
mDeviceProcessingSettings.nThreads = 1;
121
#endif
122
123
+ mDeviceMemorySize = mHostMemorySize = 0;
124
for (unsigned int i = 0; i < mChains.size(); i++) {
125
mChains[i]->RegisterPermanentMemoryAndProcessors();
126
+ size_t memGpu, memHost;
127
+ mChains[i]->MemorySize(memGpu, memHost);
128
+ mDeviceMemorySize += memGpu;
129
+ mHostMemorySize += memHost;
130
}
131
+ if (mDeviceProcessingSettings.forceMemoryPoolSize) {
132
+ mDeviceMemorySize = mHostMemorySize = mDeviceProcessingSettings.forceMemoryPoolSize;
133
+ }
134
+
135
for (unsigned int i = 0; i < mProcessors.size(); i++) {
136
(mProcessors[i].proc->*(mProcessors[i].RegisterMemoryAllocation))();
137
GPU/GPUTracking/Base/GPUReconstructionCPU.cxx
@@ -113,8 +113,10 @@ int GPUReconstructionCPU::GetThread()
113
int GPUReconstructionCPU::InitDevice()
114
{
115
if (mDeviceProcessingSettings.memoryAllocationStrategy == GPUMemoryResource::ALLOCATION_GLOBAL) {
116
- mHostMemoryPermanent = mHostMemoryBase = operator new(GPUCA_HOST_MEMORY_SIZE);
117
- mHostMemorySize = GPUCA_HOST_MEMORY_SIZE;
+ if (mDeviceMemorySize > mHostMemorySize) {
+ mHostMemorySize = mDeviceMemorySize;
118
119
+ mHostMemoryPermanent = mHostMemoryBase = operator new(mHostMemorySize);
ClearAllocatedMemory();
SetThreadCounts();
GPU/GPUTracking/Base/GPUReconstructionDeviceBase.cxx
@@ -242,15 +242,6 @@ int GPUReconstructionDeviceBase::InitDevice()
242
return (1);
243
244
245
- mDeviceMemorySize = 0;
246
- mHostMemorySize = 0;
247
- for (unsigned int i = 0; i < mChains.size(); i++) {
248
- size_t memGpu, memHost;
249
- mChains[i]->MemorySize(memGpu, memHost);
250
- mDeviceMemorySize += memGpu;
251
- mHostMemorySize += memHost;
252
- }
253
-
254
int retVal = InitDevice_Runtime();
255
if (retVal) {
256
GPUImportant("GPU Tracker initialization failed");
GPU/GPUTracking/Base/GPUSettings.cxx
@@ -79,4 +79,5 @@ void GPUSettingsDeviceProcessing::SetDefaults()
79
nStreams = 8;
80
trackletConstructorInPipeline = true;
81
trackletSelectorInPipeline = false;
82
+ forceMemoryPoolSize = 0;
83
GPU/GPUTracking/Base/GPUSettings.h
@@ -134,6 +134,7 @@ struct GPUSettingsDeviceProcessing {
int nStreams; // Number of parallel GPU streams
bool trackletConstructorInPipeline; // Run tracklet constructor in pileline like the preceeding tasks instead of as one big block
bool trackletSelectorInPipeline; // Run tracklet selector in pipeline, requres also tracklet constructor in pipeline
+ size_t forceMemoryPoolSize; // Override size of memory pool to be allocated on GPU / Host
138
};
139
} // namespace gpu
140
} // namespace GPUCA_NAMESPACE
GPU/GPUTracking/Standalone/qconfigoptions.h
@@ -129,6 +129,7 @@ AddOptionSet(nways, int, 1, "1Way", 0, "Use 3-way track-fit")
AddOption(nwaysouter, bool, false, "OuterParam", 0, "Create OuterParam")
AddOption(dzdr, float, 2.5f, "DzDr", 0, "Use dZ/dR search window instead of vertex window")
AddOption(cont, bool, false, "continuous", 0, "Process continuous timeframe data")
+AddOption(forceMemorySize, unsigned long long int, 0, "forceMemorySize", 0, "Force size of allocated GPU / page locked host memory", min(0ull))
AddOption(outputcontrolmem, unsigned long long int, 0, "outputMemory", 0, "Use predefined output buffer of this size", min(0ull), message("Using %lld bytes as output memory"))
AddOption(affinity, int, -1, "cpuAffinity", 0, "Pin CPU affinity to this CPU core", min(-1), message("Setting affinity to restrict on CPU %d"))
AddOption(fifo, bool, false, "fifoScheduler", 0, "Use FIFO realtime scheduler", message("Setting FIFO scheduler: %s"))
GPU/GPUTracking/Standalone/standalone.cxx
@@ -285,6 +285,7 @@ int SetupReconstruction()
285
devProc.nThreads = configStandalone.OMPThreads;
286
287
devProc.deviceNum = configStandalone.cudaDevice;
288
+ devProc.forceMemoryPoolSize = configStandalone.forceMemorySize;
289
devProc.debugLevel = configStandalone.DebugLevel;
290
devProc.runQA = configStandalone.qa;
291
devProc.runCompressionStatistics = configStandalone.compressionStat;
0 commit comments