Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug fix] Not setting GPU related options when --gpu=false #374

Merged
merged 4 commits into from
Nov 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down
Loading