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] 无法指定gpu #55

Closed
BruceCheng2025 opened this issue Jul 12, 2023 · 2 comments · Fixed by #148
Closed

[Bug] 无法指定gpu #55

BruceCheng2025 opened this issue Jul 12, 2023 · 2 comments · Fixed by #148
Labels
Bug Something isn't working

Comments

@BruceCheng2025
Copy link

描述该错误

无法指定gpu,无论在shell中使用CUDA_VISIBLE_DEVICES=1,还是在python中使用os.environ["CUDA_VISIBLE_DEVICES"]=1,都无法让程序只占用1卡,程序永远都会优先占用0卡。

环境信息

shell中

CUDA_VISIBLE_DEVICES=1 python run.py configs/eval_llama_7b.py -w outputs/llama_7b --gpu_idx=1

python中

parser = argparse.ArgumentParser(description='Run an evaluation task')
parser.add_argument('--gpu_idx', type=str, default=None)
args = parser.parse_args()
os.environ["CUDA_VISIBLE_DEVICES"] = args.gpu_idx

其他信息

No response

@BruceCheng2025 BruceCheng2025 added the Bug Something isn't working label Jul 12, 2023
@BruceCheng2025
Copy link
Author

将opencompass/opencompass/runners/local.py文件(A位置)中的B区域代码注释,并添加A代码,即可。

image

@tonysy
Copy link
Collaborator

tonysy commented Jul 14, 2023

PR is wlecomed for improving OpenCompass. Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants