# CUDA Runtime API error 46: all CUDA-capable devices are busy or unavailable

**URL:** <https://forums.developer.nvidia.com/t/cuda-runtime-api-error-46-all-cuda-capable-devices-are-busy-or-unavailable/50735>\
**Category:** CUDA Setup and Installation\
**Created:** [June 13, 2017, 9:25am UTC](https://forums.developer.nvidia.com/t/cuda-runtime-api-error-46-all-cuda-capable-devices-are-busy-or-unavailable/50735 "2017-06-13T09:25:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dattatray\_Sawat](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Dattatray\_Sawat](https://forums.developer.nvidia.com/u/Dattatray_Sawat)\
**Post date:** [June 13, 2017, 9:25am UTC](https://forums.developer.nvidia.com/t/cuda-runtime-api-error-46-all-cuda-capable-devices-are-busy-or-unavailable/50735/1 "2017-06-13T09:25:35Z")

</div>

Cuda8 on top of centos7 and having Nvidia Geforce940m GPU and Intel HD Graphics 520(skylake GT2). What is the cause of error?

---

<div class="post-metadata">

**Author:** ![Robert\_Crovella](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/robert_crovella/32/14043_2.png) [@Robert\_Crovella](https://forums.developer.nvidia.com/u/Robert_Crovella)\
**Post date:** [June 13, 2017, 3:52pm UTC](https://forums.developer.nvidia.com/t/cuda-runtime-api-error-46-all-cuda-capable-devices-are-busy-or-unavailable/50735/2 "2017-06-13T15:52:35Z")

</div>

If the app you are using is making use of CUDA/OGL interop, then this may happen when your OGL context gets instantiated on the HD Graphics and the CUDA context gets established on the 940m.

In that case, the solution is to force the OGL context to get instantiated on the NVIDIA GPU.

In that case, google “Optimus CUDA application profile”

---

<div class="post-metadata">

**Author:** ![Dattatray\_Sawat](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Dattatray\_Sawat](https://forums.developer.nvidia.com/u/Dattatray_Sawat)\
**Post date:** [June 15, 2017, 11:58am UTC](https://forums.developer.nvidia.com/t/cuda-runtime-api-error-46-all-cuda-capable-devices-are-busy-or-unavailable/50735/3 "2017-06-15T11:58:39Z")

</div>

Thanks tbob. it seems the GPU switching problem.  
why the nvidia-pprime package is not available for centos? what are alternatives to solve this issue?
