Skip to content
This repository has been archived by the owner on Jun 22, 2022. It is now read-only.

How to add parameter to select GPU at runtime? #23

Closed
setuc opened this issue Feb 27, 2018 · 2 comments
Closed

How to add parameter to select GPU at runtime? #23

setuc opened this issue Feb 27, 2018 · 2 comments

Comments

@setuc
Copy link

setuc commented Feb 27, 2018

Hi,
how do we add a command line parameter to the select the GPU at run time, especially on amulti gpu machine?
I tried adding

@action.command()

@click.option('-g', '--gpu', help='select gpu', default=1, required=true)
def select_gpu(gpu):
    os.environ["CUDA_VISIBLE_DEVICES"]=gpu

I tried to add a similar code block for train_evaluate_predict_pipeline and pass the gpu parameter
but i keep getting invalid option during runtime. I know its not the package issue, but the documentation did not help either

@jakubczakon
Copy link
Collaborator

jakubczakon commented Feb 27, 2018

I am working on multigpu machines and I usually do it just by going along these lines:

CUDA_VISIBLE_DEVICES=1 neptune run -- train_evaluate_predict_pipeline -p fasttext_gru

and for multigpu you just do:

CUDA_VISIBLE_DEVICES=1,2 neptune run -- train_evaluate_predict_pipeline -p fasttext_gru

I haven't tried multigpu for this project yet.

Also apart from the documentation we have quite a vibrant community here https://community.neptune.ml/
drop your issue there and I am sure someone will help.

@kamil-kaczmarek
Copy link
Member

@setuc Also, you can do $ export CUDA_VISIBLE_DEVICES=1, to select particular GPU, for entire terminal session.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants