diff --git a/src/configure.py b/src/configure.py index 2b36819c4..dee4cd08f 100755 --- a/src/configure.py +++ b/src/configure.py @@ -753,14 +753,18 @@ def set_gpu( gpus, flags, args ): gpu_opts = {} compute_capability = gpus["GPU_COMPUTE_CAPABILITY"] + if not args["gpu"]: return gpu_opts + # 1. Check the compute capability if compute_capability == "": - if args["gpu"]: raise ValueError("GPU_COMPUTE_CAPABILITY is not set in `../configs/%s.config`. See `../configs/template.config` for illustration."%args["machine"]) - return gpu_opts + raise ValueError("GPU_COMPUTE_CAPABILITY is not set in `../configs/%s.config`. See `../configs/template.config` for illustration."%args["machine"]) compute_capability = int(compute_capability) if compute_capability < 0: - compute_capability = get_gpu_compute_capability() + try: + compute_capability = get_gpu_compute_capability() + except: + raise ValueError("Fail to set GPU_COMPUTE_CAPABILITY automatically! Please set it manually in `../configs/%s.config`."%args["machine"]) elif compute_capability < 200: raise ValueError("Incorrect GPU_COMPUTE_CAPABILITY range (>=200)") gpu_opts["GPU_COMPUTE_CAPABILITY"] = str(compute_capability) @@ -999,7 +1003,7 @@ def warning( paths, **kwargs ): for key in re.findall(r"@@@(.+?)@@@", makefile): makefile, num = re.subn(r"@@@%s@@@"%key, "", makefile) if num == 0: raise BaseException("The string @@@%s@@@ is not replaced correctly."%key) - LOGGER.warning("@@@%s@@@ is replaced to '' since there is no given value."%key) + LOGGER.warning("@@@%s@@@ is replaced to '' since the value is not given or the related option is disabled."%key) # 4.3 Write with open( GAMER_MAKE_OUT, "w") as make_out: