Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:49:30

0001 from HeterogeneousCore.SonicTriton.TritonService_cfi import *
0002 
0003 from Configuration.ProcessModifiers.enableSonicTriton_cff import enableSonicTriton
0004 
0005 _gpu_available_cached = None
0006 
0007 def _gpu_available():
0008     global _gpu_available_cached
0009     if _gpu_available_cached is None:
0010         import os
0011         _gpu_available_cached = (os.system("nvidia-smi -L") == 0)
0012     return _gpu_available_cached
0013 
0014 enableSonicTriton.toModify(TritonService,
0015     fallback = dict(
0016         enable = True,
0017         useGPU = _gpu_available(),
0018     ),
0019 )