      ws("workspace/${TASK}") {
        checkout scm
        // conda environment
        def ENV_NAME = "${TASK}-${EXECUTOR_NUMBER}";
        // assign two GPUs to each build
        def EID = EXECUTOR_NUMBER.toInteger()
        def CUDA_VISIBLE_DEVICES=(EID*2).toString() + ',' + (EID*2+1).toString();
  
        sh label: "Build Environment", script: """set -ex
        conda env update -n ${ENV_NAME} -f static/build.yml
        pip list
        nvidia-smi
 
</s> remove       export CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES}
 </s> add  </s> remove       export CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES}
 </s> add  </s> remove       export CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES}
 </s> add 
      ws("workspace/${TASK}") {
        checkout scm
        // conda environment
        def ENV_NAME = "${TASK}-${EXECUTOR_NUMBER}";



  
        sh label: "Build Environment", script: """set -ex
        conda env update -n ${ENV_NAME} -f static/build.yml
        pip list
        nvidia-smi
keep keep keep keep replace replace replace keep keep keep keep keep
 Remove GPU constraints in Jenkins

refer to https://github.com/d2l-ai/d2l-en/pull/1645 
Jenkinsfile