Skip to content

Commit

Permalink
Do not disable the CUDAService at HLT if there are no GPUs (cms-sw#607)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fwyzard committed Mar 3, 2021
1 parent 52c6102 commit 7b4358f
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions HLTrigger/Configuration/python/customizeHLTforPatatrack.py
Expand Up @@ -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")

Expand Down

0 comments on commit 7b4358f

Please sign in to comment.