# How to use an NVIDIA GPU on an x86 device with balenaOS

**URL:** <https://forums.balena.io/t/how-to-use-an-nvidia-gpu-on-an-x86-device-with-balenaos/350644>\
**Category:** Discussions\
**Created:** [December 21, 2021, 10:34pm UTC](https://forums.balena.io/t/how-to-use-an-nvidia-gpu-on-an-x86-device-with-balenaos/350644 "2021-12-21T22:34:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrewnhem](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/andrewnhem/32/4284_2.png) [@andrewnhem](https://forums.balena.io/u/andrewnhem)\
**Post date:** [December 21, 2021, 10:34pm UTC](https://forums.balena.io/t/how-to-use-an-nvidia-gpu-on-an-x86-device-with-balenaos/350644/1 "2021-12-21T22:34:02Z")

</div>

Please use the thread below to discuss the related blog post:

> **[How to use an NVIDIA GPU on an x86 device with balenaOS](https://www.balena.io/blog/how-to-use-nvidia-gpu-on-x86-device-balenaOS/)**
>
> In this guide, we'll outline how to access an NVIDIA GPU on an x86 (PC) device to run CUDA or any other containerized software that requires GPU access.

---

<div class="post-metadata">

**Author:** ![eeb](https://avatars.discourse-cdn.com/v4/letter/e/65b543/32.png) [@eeb](https://forums.balena.io/u/eeb)\
**Post date:** [April 6, 2022, 2:52pm UTC](https://forums.balena.io/t/how-to-use-an-nvidia-gpu-on-an-x86-device-with-balenaos/350644/2 "2022-04-06T14:52:48Z")

</div>

Hello,

Have you tried the `update HostOS flow` and is there some guide on steps rebuild the drivers with the new kernel modules?

Reason I ask is that we are trying to integrate this solution into our product, and actions like driver updates work ok, but the moment that we update the Host OS, even after the drivers get rebuilt, is impossible to insert them.

Regards,

---

<div class="post-metadata">

**Author:** ![DimaK](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@DimaK](https://forums.balena.io/u/DimaK)\
**Post date:** [November 30, 2022, 2:02pm UTC](https://forums.balena.io/t/how-to-use-an-nvidia-gpu-on-an-x86-device-with-balenaos/350644/5 "2022-11-30T14:02:48Z")

</div>

Is there any more convenient way to get Nvidia drivers and stuff running?  
Seems that in 5.x kernels unloading Nouveau module causes an exception (infamous nvkm\_falcon\_v1\_wait\_for\_halt), leaving GPU in some intermediate state and crashing Nvidia original drivers.

---

<div class="post-metadata">

**Author:** ![haronaut](https://avatars.discourse-cdn.com/v4/letter/h/2acd7d/32.png) [@haronaut](https://forums.balena.io/u/haronaut)\
**Post date:** [February 22, 2023, 2:45pm UTC](https://forums.balena.io/t/how-to-use-an-nvidia-gpu-on-an-x86-device-with-balenaos/350644/6 "2023-02-22T14:45:47Z")

</div>

For a user other than root inside the container, the GPU access did not work. I had to add the user to the nvidia-persistenced group.

```auto
RUN usermod -a -G nvidia-persistenced <user>

```
