# Sweep on remote cluster GPUs

**URL:** <https://community.wandb.ai/t/sweep-on-remote-cluster-gpus/2731>\
**Category:** W&B Help\
**Tags:** sweeps\
**Created:** [July 9, 2022, 5:40pm UTC](https://community.wandb.ai/t/sweep-on-remote-cluster-gpus/2731 "2022-07-09T17:40:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreakiro](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@andreakiro](https://community.wandb.ai/u/andreakiro)\
**Post date:** [July 9, 2022, 5:40pm UTC](https://community.wandb.ai/t/sweep-on-remote-cluster-gpus/2731/1 "2022-07-09T17:40:56Z")

</div>

Hey. I’m trying to run a sweep on a cluster GPUs by submitting it as a new job.  
The problem is that the job runs, but keep logging a network error:

> wandb: Network error (ConnectionError), entering retry loop.

The script works fine if I’m trying to run it “locally” in the cluster i.e. without submitting a GPU job.  
My intuition is that W&B doesn’t find my creds (.netrc file) on the node its running. So I was wondering if there is a way to directly pass my API key to the wandb.agent function, so that the script is independent of its execution environment?

Thanks

---

<div class="post-metadata">

**Author:** ![nathank](https://avatars.discourse-cdn.com/v4/letter/n/7ea924/32.png) [@nathank](https://community.wandb.ai/u/nathank)\
**Post date:** [July 13, 2022, 1:45pm UTC](https://community.wandb.ai/t/sweep-on-remote-cluster-gpus/2731/2 "2022-07-13T13:45:56Z")

</div>

Hi @andreakiro,  
You can also use the environment variables `WANDB_API_KEY` and `WANDB_BASE_URL` (if using local server and not connecting to [wandb.ai](http://wandb.ai)) and `wandb` will look there instead of a `.netrc` file. Alternatively in Python you can use `wandb.login(key=<your_api_key>)` but we recommend using caution with this as you can potentially expose your API key since it is getting hard coded into your script.

I’m a little suspicious that this is the cause of your issues though as this usually shows up as an “Invalid or missing API key” error. If this doesn’t resolve the issue, could you try to run `ping api.wandb.ai` (or whichever url endpoint you are trying to create runs to) on the cluster GPU to confirm that the GPU has no issue sending network packets to our backend?

Thank you,  
Nate

---

<div class="post-metadata">

**Author:** ![gsaltintas](https://avatars.discourse-cdn.com/v4/letter/g/53a042/32.png) [@gsaltintas](https://community.wandb.ai/u/gsaltintas)\
**Post date:** [July 18, 2022, 10:42pm UTC](https://community.wandb.ai/t/sweep-on-remote-cluster-gpus/2731/3 "2022-07-18T22:42:25Z")

</div>

Hi @andreakiro , sometimes cluster admins disable network access on compute nodes for security reasons. You may need to load a proxy module (this may depend on your cluster) before running your sweep so that it gets logged during training.  
Good luck!

---

<div class="post-metadata">

**Author:** ![nathank](https://avatars.discourse-cdn.com/v4/letter/n/7ea924/32.png) [@nathank](https://community.wandb.ai/u/nathank)\
**Post date:** [July 20, 2022, 4:06am UTC](https://community.wandb.ai/t/sweep-on-remote-cluster-gpus/2731/4 "2022-07-20T04:06:17Z")

</div>

Hi @andreakiro,  
I just wanted to follow up and see if you were still looking for help with this and if you had a chance to try running `ping` against [api.wandb.ai](http://api.wandb.ai)?  
Thank you,  
Nate

---

<div class="post-metadata">

**Author:** ![lesliewandb](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/lesliewandb/32/369_2.png) [@lesliewandb](https://community.wandb.ai/u/lesliewandb)\
**Post date:** [July 25, 2022, 5:14pm UTC](https://community.wandb.ai/t/sweep-on-remote-cluster-gpus/2731/5 "2022-07-25T17:14:55Z")

</div>

Hi Andrea, since we have not heard back from you we are going to close this request. If you would like to re-open the conversation, please let us know!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/366b649231631dbab896843020da0056074ac79d.png) [@system](https://community.wandb.ai/u/system)\
**Post date:** [September 18, 2022, 4:06am UTC](https://community.wandb.ai/t/sweep-on-remote-cluster-gpus/2731/6 "2022-09-18T04:06:33Z")

</div>

Closed on September 18, 2022, 4:06am UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
