From 7b4358fda521991a2aeed1d186f3a69ca85516c8 Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Wed, 3 Mar 2021 17:10:55 +0100 Subject: [PATCH] Do not disable the CUDAService at HLT if there are no GPUs (#607) The CUDAService already checks for the availability of a suitable GPU at job startup, so there is no need to explicitly disable it in the python configuration. This fixes the case where the configuration is expanded or pickled on a machine without GPUs, and then run on a machine with a GPU: in this case the CUDAService gets incorrectly disabled, breaking the configuration itself. --- HLTrigger/Configuration/python/customizeHLTforPatatrack.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/HLTrigger/Configuration/python/customizeHLTforPatatrack.py b/HLTrigger/Configuration/python/customizeHLTforPatatrack.py index 02b36ed11b2f6..5164188c94997 100644 --- a/HLTrigger/Configuration/python/customizeHLTforPatatrack.py +++ b/HLTrigger/Configuration/python/customizeHLTforPatatrack.py @@ -18,19 +18,12 @@ def resetGpuOffload(): HeterogeneousCore.CUDACore.SwitchProducerCUDA._switch_cuda() -# check if CUDA is enabled, using the same mechanism as the SwitchProducerCUDA -def cudaIsEnabled(): - import HeterogeneousCore.CUDACore.SwitchProducerCUDA - return HeterogeneousCore.CUDACore.SwitchProducerCUDA._switch_cuda()[0] - - # customisation for running the Patatrack reconstruction, common parts def customiseCommon(process): # Services process.load("HeterogeneousCore.CUDAServices.CUDAService_cfi") - process.CUDAService.enabled = cudaIsEnabled() process.load("HeterogeneousCore.CUDAServices.NVProfilerService_cfi")