# Use case for setting CUDA\_VISIBLE\_DEVICES in cgroups hook

**URL:** <https://community.openpbs.org/t/use-case-for-setting-cuda-visible-devices-in-cgroups-hook/2218>\
**Category:** Developers\
**Created:** [July 27, 2020, 6:59pm UTC](https://community.openpbs.org/t/use-case-for-setting-cuda-visible-devices-in-cgroups-hook/2218 "2020-07-27T18:59:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dtalcott](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/dtalcott/32/410_2.png) [@dtalcott](https://community.openpbs.org/u/dtalcott)\
**Post date:** [July 27, 2020, 6:59pm UTC](https://community.openpbs.org/t/use-case-for-setting-cuda-visible-devices-in-cgroups-hook/2218/1 "2020-07-27T18:59:39Z")

</div>

What is the use case for setting the CUDA\_VISIBLE\_DEVICES environment variable in the pbs\_cgroups hook? That is, when you have a multi-node MPI type job, the CUDA\_VISIBLE\_DEVICES variable from the first node gets propagated to the other nodes, where it makes no sense and causes failures.

So far in our testing, we have had no issues not setting the variable at all. The Nvidia routines and CUDA applications appear to run okay and on the GPUs enabled by the device cgroup for each node. Is there some use case we are missing?

Thanks.
