# How to ask for a specific GPU?

**URL:** <http://hpc-community.unige.ch/t/how-to-ask-for-a-specific-gpu/2116>\
**Category:** Uncategorized\
**Created:** [March 29, 2022, 4:25pm UTC](http://hpc-community.unige.ch/t/how-to-ask-for-a-specific-gpu/2116 "2022-03-29T16:25:16Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ludovic.Dumoulin](http://hpc-community.unige.ch/letter_avatar_proxy/v4/letter/l/c2a13f/32.png) [@Ludovic.Dumoulin](http://hpc-community.unige.ch/u/Ludovic.Dumoulin)\
**Post date:** [March 29, 2022, 4:25pm UTC](http://hpc-community.unige.ch/t/how-to-ask-for-a-specific-gpu/2116/1 "2022-03-29T16:25:16Z")

</div>

Hello,  
Now that there are RTX 3080 and 3090, when I ask for an ampere card I can get these GPUs. It is really annoying, is it possible to ask only for A100 gpus ?  
There is probably a solution but I don’t know SLURM.  
I would try to use `--nodelist=gpu[020,022,027,028]` but I don’t want to affect negatively the cluster then I prefer to ask first.  
Thank you,  
Ludovic

---

<div class="post-metadata">

**Author:** ![Yann.Sagon](http://hpc-community.unige.ch/user_avatar/hpc-community.unige.ch/yann.sagon/32/3_2.png) [@Yann.Sagon](http://hpc-community.unige.ch/u/Yann.Sagon)\
**Post date:** [March 30, 2022, 12:19pm UTC](http://hpc-community.unige.ch/t/how-to-ask-for-a-specific-gpu/2116/2 "2022-03-30T12:19:02Z")

</div>

Hi @Ludovic.Dumoulin a change we can made is to add a `feature`. For example: `COMPUTE_MODEL_A100_40G`. I’m adding the memory size to be able to specify exactly the model as the new A100 has 80G

So you should be able to request an A100 like that:

`sbatch --constraint=COMPUTE_MODEL_A100_40G --gpus=1 xxx`

Does it sounds good for you?

---

<div class="post-metadata">

**Author:** ![Ludovic.Dumoulin](http://hpc-community.unige.ch/letter_avatar_proxy/v4/letter/l/c2a13f/32.png) [@Ludovic.Dumoulin](http://hpc-community.unige.ch/u/Ludovic.Dumoulin)\
**Post date:** [March 30, 2022, 1:29pm UTC](http://hpc-community.unige.ch/t/how-to-ask-for-a-specific-gpu/2116/3 "2022-03-30T13:29:47Z")

</div>

It would be perfect !!!  
Thank you so much if you can do that !

I don’t have a memory constraint. The constraint is about TFLOPS in double precision, RTX 30… are not made for hydrodynamics but for machine learning (and gaming). Then the simulation time of my system on A100 is approximately 5h and of more than 16h on RTX. I don’t know exactly because I ask only for 8h, it is large enough for A100 but not enough to complete half of my simulation on RTX.

Maybe a constraint on double/single precision might do, like:  
`sbatch --constraint=DOUBLE_PRECISION --gres=gpu:ampere:1`  
with this constraint it is also possible to ask for P100 (or V100) that is 10 (15) times more effective than a RTX3090 for FP64 if you don’t need FP64 tensor core.  
(`sbatch --constraint=DOUBLE_PRECISION --gpus=1`)

I think a way of sorting ML/Hydro cards would be nice.  
(When I say Hydro I mean any computation or data analysis that need FP64)

---

<div class="post-metadata">

**Author:** ![Yann.Sagon](http://hpc-community.unige.ch/user_avatar/hpc-community.unige.ch/yann.sagon/32/3_2.png) [@Yann.Sagon](http://hpc-community.unige.ch/u/Yann.Sagon)\
**Post date:** [March 31, 2022, 8:55am UTC](http://hpc-community.unige.ch/t/how-to-ask-for-a-specific-gpu/2116/4 "2022-03-31T08:55:24Z")

</div>

Hi,

we added a constraint: `DOUBLE_PRECISION_GPU` for those GPUs:

| model | Architecture | RAM | compute capability | slurm resource | nb | nodes |
| --- | --- | --- | --- | --- | --- | --- |
| P100 | Pascal | 12GB | 6.0 | pascal | 6 | gpu[004].baobab |
| P100 | Pascal | 12GB | 6.0 | pascal | 5 | gpu[005].baobab |
| P100 | Pascal | 12GB | 6.0 | pascal | 8 | gpu[006].baobab |
| P100 | Pascal | 12GB | 6.0 | pascal | 4 | gpu[007].baobab |
| A100 | Ampere | 40GB | 8.0 | ampere | 2 | gpu[020,027].baobab |
| A100 | Ampere | 40GB | 8.0 | ampere | 6 | gpu[022].baobab |
| A100 | Ampere | 40GB | 8.0 | ampere | 1 | gpu[028].baobab |
| V100 | Volta | 32GB | 7.0 | volta | 1 | gpu[008].yggdrasil |

Please check if it fits your needs.

Best

---

<div class="post-metadata">

**Author:** ![Hugues.Turbe](http://hpc-community.unige.ch/letter_avatar_proxy/v4/letter/h/e47774/32.png) [@Hugues.Turbe](http://hpc-community.unige.ch/u/Hugues.Turbe)\
**Post date:** [March 31, 2022, 2:48pm UTC](http://hpc-community.unige.ch/t/how-to-ask-for-a-specific-gpu/2116/5 "2022-03-31T14:48:14Z")

</div>

Hi,

I have a similar issue, I would like to use only RTX 3090 and not the 3080 (due to memory constraints). It appears that there is no way to ask for a specific GPU memory in SLURM and I was therefore wondering if there is a way to specify only RTX 3090?

Best,

Hugues

---

<div class="post-metadata">

**Author:** ![Ludovic.Dumoulin](http://hpc-community.unige.ch/letter_avatar_proxy/v4/letter/l/c2a13f/32.png) [@Ludovic.Dumoulin](http://hpc-community.unige.ch/u/Ludovic.Dumoulin)\
**Post date:** [March 31, 2022, 3:12pm UTC](http://hpc-community.unige.ch/t/how-to-ask-for-a-specific-gpu/2116/6 "2022-03-31T15:12:17Z")

</div>

It works well, thank you !

---

<div class="post-metadata">

**Author:** ![Yann.Sagon](http://hpc-community.unige.ch/user_avatar/hpc-community.unige.ch/yann.sagon/32/3_2.png) [@Yann.Sagon](http://hpc-community.unige.ch/u/Yann.Sagon)\
**Post date:** [April 1, 2022, 11:34am UTC](http://hpc-community.unige.ch/t/how-to-ask-for-a-specific-gpu/2116/7 "2022-04-01T11:34:05Z")

</div>

Hi, right now, the only way seems to list explicitly the nodes to be used.

What we can do is to add a constraint with the GPU model name such as :

`RTX_3090_25G` and `RTX_3090`

---

<div class="post-metadata">

**Author:** ![Manel.LopezMelia](http://hpc-community.unige.ch/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@Manel.LopezMelia](http://hpc-community.unige.ch/u/Manel.LopezMelia)\
**Post date:** [November 30, 2022, 3:43pm UTC](http://hpc-community.unige.ch/t/how-to-ask-for-a-specific-gpu/2116/8 "2022-11-30T15:43:24Z")

</div>

Hi, is there any change in the way we can specify the memory of a GPU?  
I would need more than 12 GB and my SLURM script I have

```auto
#SBATCH -p private-cui-gpu
#SBATCH --gpus=titan:1

```

so I guess I’m short on memory. If I try to request an Ampere GPU, I get this message:

```auto
sbatch: error: Batch job submission failed: Requested node configuration is not available

```

and if I try the constraint to get A100 40G, I get the following:

```auto
sbatch: error: Batch job submission failed: Invalid feature specification

```

I think that the RTX 3090 would be fine for my case, as I don’t need double precision. How should I write the request to use it?

Thanks!

---

<div class="post-metadata">

**Author:** ![Manel.LopezMelia](http://hpc-community.unige.ch/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@Manel.LopezMelia](http://hpc-community.unige.ch/u/Manel.LopezMelia)\
**Post date:** [December 1, 2022, 2:14pm UTC](http://hpc-community.unige.ch/t/how-to-ask-for-a-specific-gpu/2116/9 "2022-12-01T14:14:47Z")

</div>

Hi, as suggested by @Yann.Sagon in the HPC Lunch today, I could use more memory in GPU with the following commands in my batch file:

```auto
#--- CPU
#SBATCH --mem=20G

#--- GPU
#SBATCH -p shared-gpu
#SBATCH --gpus=1
#SBATCH --gres=gpu:1,VramPerGpu:20G

```

Indeed, Yann, without requesting memory for the CPU as well, I get this OOM error message:

```auto
slurmstepd: error: Detected 1 oom-kill event(s) in StepId=62400628.0. Some of your processes may have been killed by the cgroup out-of-memory handler.
srun: error: gpu009: task 0: Out Of Memory
slurmstepd: error: Detected 1 oom-kill event(s) in StepId=62400628.batch. Some of your processes may have been killed by the cgroup out-of-memory handler.

```

Thanks for your help, Yann! 🙂

---

<div class="post-metadata">

**Author:** ![Yann.Sagon](http://hpc-community.unige.ch/user_avatar/hpc-community.unige.ch/yann.sagon/32/3_2.png) [@Yann.Sagon](http://hpc-community.unige.ch/u/Yann.Sagon)\
**Post date:** [December 1, 2022, 2:16pm UTC](http://hpc-community.unige.ch/t/how-to-ask-for-a-specific-gpu/2116/10 "2022-12-01T14:16:34Z")

</div>

Hi, glad it helped! I would suggest to remove or lower the VramPerGPu to 10G. Maybe the issue was only the lack of CPU ram and not the GPU model?

---

<div class="post-metadata">

**Author:** ![Manel.LopezMelia](http://hpc-community.unige.ch/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@Manel.LopezMelia](http://hpc-community.unige.ch/u/Manel.LopezMelia)\
**Post date:** [December 1, 2022, 2:20pm UTC](http://hpc-community.unige.ch/t/how-to-ask-for-a-specific-gpu/2116/11 "2022-12-01T14:20:01Z")

</div>

Sure! I will try it! Also I’m trying with cropped input 3D images, but I’m not sure yet on the performance of the model in this case. If possible, I’ll use this reduced input instead and I won’t need to request extra memory at all! 😃

---

<div class="post-metadata">

**Author:** ![Yazdan.Salimi](http://hpc-community.unige.ch/letter_avatar_proxy/v4/letter/y/9d8465/32.png) [@Yazdan.Salimi](http://hpc-community.unige.ch/u/Yazdan.Salimi)\
**Post date:** [April 3, 2024, 11:52am UTC](http://hpc-community.unige.ch/t/how-to-ask-for-a-specific-gpu/2116/12 "2024-04-03T11:52:22Z")

</div>

Thank you for the information.  
Is there a way to indicate the GPU number such as gpu[028]?

---

<div class="post-metadata">

**Author:** ![Yann.Sagon](http://hpc-community.unige.ch/user_avatar/hpc-community.unige.ch/yann.sagon/32/3_2.png) [@Yann.Sagon](http://hpc-community.unige.ch/u/Yann.Sagon)\
**Post date:** [April 3, 2024, 12:52pm UTC](http://hpc-community.unige.ch/t/how-to-ask-for-a-specific-gpu/2116/13 "2024-04-03T12:52:44Z")

</div>

Hi, this is an old thread. What is your issue and why do you need to specify the exact gpu number? If this is a brand new topic, feel free to create a new thread on the forum.

Best
