# NVIDIA drivers on Intel Nuc

**URL:** <https://forums.balena.io/t/nvidia-drivers-on-intel-nuc/2903>\
**Category:** Product support\
**Created:** [April 11, 2018, 8:18am UTC](https://forums.balena.io/t/nvidia-drivers-on-intel-nuc/2903 "2018-04-11T08:18:24Z")\
**Posts on this page:** 16\
**Page:** 2

<div class="post-metadata">

**Author:** ![zubairlk](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/zubairlk/32/954_2.png) [@zubairlk](https://forums.balena.io/u/zubairlk)\
**Post date:** [November 13, 2019, 1:30pm UTC](https://forums.balena.io/t/nvidia-drivers-on-intel-nuc/2903/28 "2019-11-13T13:30:28Z")

</div>

Hi,

You haven’t added an `apt-get update` in the Dockerfile to populate the apt-cache.

And afterwards, the exact package name isn’t nvidia-driver I think.

```auto
root@b3789a28b8f9:/# apt-cache search nvidia-driver
nvidia-304 - NVIDIA legacy binary driver - version 304.135
nvidia-304-updates - Transitional package for nvidia-304
nvidia-340 - NVIDIA binary driver - version 340.107
nvidia-361 - Transitional package for nvidia-367
nvidia-384 - NVIDIA binary driver - version 384.130
root@b3789a28b8f9:/# 

```

I think you’ll need to install a specific driver. e.g. nvidia-384

---

<div class="post-metadata">

**Author:** ![scarlyon](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@scarlyon](https://forums.balena.io/u/scarlyon)\
**Post date:** [November 13, 2019, 7:34pm UTC](https://forums.balena.io/t/nvidia-drivers-on-intel-nuc/2903/30 "2019-11-13T19:34:04Z")

</div>

Yes, that works!  
But sadly, `nvidia-smi` doesn’t detect my board…

```auto
root@balena:/# lshw -C display
  *-display UNCLAIMED       
       description: VGA compatible controller
       product: GM204 [GeForce GTX 970]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list
       configuration: latency=0
       resources: memory:a2000000-a2ffffff memory:90000000-9fffffff memory:a0000000-a1ffffff ioport:3000(size=128) memory:c0000-dffff
root@balena:/# nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

```

Not sure what’s wrong?  
Here is my full `Dockerfile.template` file:

```auto
FROM balenalib/%%BALENA_MACHINE_NAME%%-ubuntu-python:3.6-bionic-build

ENV RESINOS_VERSION=2.29.0%2Brev1.prod

ENV YOCTO_VERSION=4.12.12
RUN wget https://files.resin.io/images/intel-nuc/${RESINOS_VERSION}/kernel_modules_headers.tar.gz
RUN tar -xf kernel_modules_headers.tar.gz && rm -rf kernel_modules_headers.tar.gz
RUN mkdir -p /lib/modules/${YOCTO_VERSION}-yocto-standard
RUN mv ./kernel_modules_headers /lib/modules/${YOCTO_VERSION}-yocto-standard/build
RUN ln -s /lib64/ld-linux-x86-64.so.2 /lib/ld-linux-x86-64.so.2
RUN apt-get update && apt-cache search nvidia-driver
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get install -y nvidia-driver-390

# Enable udevd so that plugged dynamic hardware devices show up in our container.
ENV UDEV=1

ENV INITSYSTEM on

CMD ["sleep", "infinity"]

```

---

<div class="post-metadata">

**Author:** ![pdcastro](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/pdcastro/32/1264_2.png) [@pdcastro](https://forums.balena.io/u/pdcastro)\
**Post date:** [November 13, 2019, 9:30pm UTC](https://forums.balena.io/t/nvidia-drivers-on-intel-nuc/2903/36 "2019-11-13T21:30:06Z")

</div>

@scarlyon, I don’t have a solution but I can ask some questions that may help us help you:

- What is the output of the following command on the host OS prompt of your NUC device?  
`uname -a && cat /etc/issue && lsmod`

- What is the build output for the Dockerfile? (E.g. output of the `"balena push"` or `"git push"` command.) Could there have been any errors in building the drivers?

If the output is too large to paste in the body of message, maybe it could be attached as zip or created in a [gist.github.com](http://gist.github.com) page. Just some suggestions.

---

<div class="post-metadata">

**Author:** ![scarlyon](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@scarlyon](https://forums.balena.io/u/scarlyon)\
**Post date:** [November 13, 2019, 11:25pm UTC](https://forums.balena.io/t/nvidia-drivers-on-intel-nuc/2903/38 "2019-11-13T23:25:53Z")

</div>

```auto
root@balena:~# uname -a && cat /etc/issue && lsmod
Linux balena 5.2.10-yocto-standard #1 SMP PREEMPT Fri Oct 4 11:58:01 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
balenaOS 2.44.0 \n \l

Module Size Used by
ip6table_filter 16384 0
ip6_tables 28672 1 ip6table_filter
xt_MASQUERADE 16384 3
nf_conntrack_netlink 32768 0
nfnetlink 16384 2 nf_conntrack_netlink
xfrm_user 36864 1
br_netfilter 24576 0
xt_owner 16384 0
cfg80211 598016 0
snd_hda_codec_hdmi 49152 1
wmi_bmof 16384 0
x86_pkg_temp_thermal 16384 0
coretemp 16384 0
snd_hda_codec_realtek 90112 1
snd_hda_codec_generic 65536 1 snd_hda_codec_realtek
iTCO_wdt 16384 0
watchdog 20480 1 iTCO_wdt
snd_hda_intel 32768 0
snd_hda_codec 94208 4 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek
efivars 20480 0
snd_hda_core 65536 5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek
snd_pcm 81920 4 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_core
snd_timer 28672 1 snd_pcm
wmi 20480 1 wmi_bmof
video 36864 0
backlight 16384 1 video
nls_cp437 20480 1
vfat 24576 1
fat 69632 1 vfat
sch_fq_codel 20480 2

```

Installation log: [https://pastebin.com/F4uxGR4X](https://pastebin.com/F4uxGR4X)

Here is my `docker-compose.yml` file:

```auto
version: '2'
volumes:
    resin-data:
services:
  gpu:
    build: ./gpu
    volumes:
      - 'resin-data:/data'
# - 'nvidia_driver_390:/usr/local/nvidia:ro'
    restart: always
    privileged: true
    network_mode: host
    labels:
      io.balena.features.supervisor-api: '1'
    cap_add:
      - SYS_RAWIO
    devices:
      - "/dev:/dev"
      - /dev/nvidia0
      - /dev/nvidia1
      - /dev/nvidiactl
      - /dev/nvidia-uvm
      - /dev/nvidia-uvm-tools

```

Thanks! @pdcastro

---

<div class="post-metadata">

**Author:** ![shaunmulligan](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/shaunmulligan/32/34_2.png) [@shaunmulligan](https://forums.balena.io/u/shaunmulligan)\
**Post date:** [November 13, 2019, 11:42pm UTC](https://forums.balena.io/t/nvidia-drivers-on-intel-nuc/2903/42 "2019-11-13T23:42:26Z")

</div>

Hi Shane. One thing I noticed from your output here is that you are running the container on balenaOS 2.44, but building the kernel module for balenaOS 2.29. If i recall, there were some major kernel bumps from 4.18 to 5.2 between those two OS versions, so it might be worth making sure your Dockerfile targets the 2.44 version.

---

<div class="post-metadata">

**Author:** ![scarlyon](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@scarlyon](https://forums.balena.io/u/scarlyon)\
**Post date:** [November 13, 2019, 11:55pm UTC](https://forums.balena.io/t/nvidia-drivers-on-intel-nuc/2903/43 "2019-11-13T23:55:44Z")

</div>

@shaunmulligan  
I used 2.29 cause I couldn’t find the link of the linux header file.

Could you give me the full url of that file?

This seems broken for 2.44?  
[https://files.resin.io/images/intel-nuc/${RESINOS\_VERSION}/kernel\_modules\_headers.tar.gz](https://files.resin.io/images/intel-nuc/%24%7BRESINOS_VERSION%7D/kernel_modules_headers.tar.gz)

---

<div class="post-metadata">

**Author:** ![shaunmulligan](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/shaunmulligan/32/34_2.png) [@shaunmulligan](https://forums.balena.io/u/shaunmulligan)\
**Post date:** [November 14, 2019, 12:02am UTC](https://forums.balena.io/t/nvidia-drivers-on-intel-nuc/2903/44 "2019-11-14T00:02:09Z")

</div>

I think it should just be:

```auto
https://files.resin.io/images/intel-nuc/2.44.0%2Brev1.prod/kernel_modules_headers.tar.gz

```

that seems to work for me, at least from my browser. Haven’t tested it with the OOT kernel modules script though.

---

<div class="post-metadata">

**Author:** ![scarlyon](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@scarlyon](https://forums.balena.io/u/scarlyon)\
**Post date:** [November 14, 2019, 3:31am UTC](https://forums.balena.io/t/nvidia-drivers-on-intel-nuc/2903/46 "2019-11-14T03:31:20Z")

</div>

Odd, your link was not working yesterday, but working now… 🙂

But unfortunately, `nvidia-smi` is still not working… 😕  
@shaunmulligan

---

<div class="post-metadata">

**Author:** ![mikesimos](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mikesimos/32/1418_2.png) [@mikesimos](https://forums.balena.io/u/mikesimos)\
**Post date:** [November 14, 2019, 11:28am UTC](https://forums.balena.io/t/nvidia-drivers-on-intel-nuc/2903/47 "2019-11-14T11:28:23Z")

</div>

Hey Shane,  
Can you also confirm you 're setting the right `YOCTO_VERSION` envvar ? From the above shared output, that should be set to `5.2.10`. Could you share the relevant section of your Dockerfile?  
Thanks!

---

<div class="post-metadata">

**Author:** ![scarlyon](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@scarlyon](https://forums.balena.io/u/scarlyon)\
**Post date:** [November 14, 2019, 8:36pm UTC](https://forums.balena.io/t/nvidia-drivers-on-intel-nuc/2903/49 "2019-11-14T20:36:32Z")

</div>

@mikesimos  
Here is the current configuration:

```auto
FROM balenalib/%%BALENA_MACHINE_NAME%%-ubuntu-python:3.6-bionic-build

ENV RESINOS_VERSION=2.44.0%2Brev1.prod

ENV YOCTO_VERSION=5.2.10
RUN wget https://files.resin.io/images/intel-nuc/${RESINOS_VERSION}/kernel_modules_headers.tar.gz
RUN tar -xf kernel_modules_headers.tar.gz && rm -rf kernel_modules_headers.tar.gz
RUN mkdir -p /lib/modules/${YOCTO_VERSION}-yocto-standard
RUN mv ./kernel_modules_headers /lib/modules/${YOCTO_VERSION}-yocto-standard/build
RUN ln -s /lib64/ld-linux-x86-64.so.2 /lib/ld-linux-x86-64.so.2
RUN apt-get update && apt-cache search nvidia-driver
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get install -y nvidia-driver-390

# Enable udevd so that plugged dynamic hardware devices show up in our container.
ENV UDEV=1

ENV INITSYSTEM on

CMD ["sleep", "infinity"]

```

Cheers.

---

<div class="post-metadata">

**Author:** ![hedss](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/hedss/32/210_2.png) [@hedss](https://forums.balena.io/u/hedss)\
**Post date:** [November 15, 2019, 4:21pm UTC](https://forums.balena.io/t/nvidia-drivers-on-intel-nuc/2903/54 "2019-11-15T16:21:34Z")

</div>

Hi there,

I’ve noticed that there’s a failure whilst building modules with that Dockerfile:

```auto
[main] DKMS: install completed.
[main] Building initial module for 5.2.10-yocto-standard
[main] Error! Bad return status for module build on kernel: 5.2.10-yocto-standard (x86_64)
[main] Consult /var/lib/dkms/nvidia/390.116/build/make.log for more information.

```

Looking at the build logs, there’s a problem with redefinition of a function in one of the headers. It looks like 390 was actually pretty broken, and I tracked the issue down to this: [https://devtalk.nvidia.com/default/topic/1054883/linux/nvidia-390-116-cannot-build-modules-on-fedara-30-kernel-5-1-5-300-fc30-x86\_64/](https://devtalk.nvidia.com/default/topic/1054883/linux/nvidia-390-116-cannot-build-modules-on-fedara-30-kernel-5-1-5-300-fc30-x86_64/)

Can you try with `RUN apt-get install -y nvidia-driver-435` instead of `RUN apt-get install -y nvidia-driver-390` as this seems to build cleanly, and let us know how it goes?

Best regards,

Heds

---

<div class="post-metadata">

**Author:** ![hedss](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/hedss/32/210_2.png) [@hedss](https://forums.balena.io/u/hedss)\
**Post date:** [November 15, 2019, 4:26pm UTC](https://forums.balena.io/t/nvidia-drivers-on-intel-nuc/2903/57 "2019-11-15T16:26:21Z")

</div>

As an aside, could you let us know the exact hardware this is running on please?

Thanks,

Heds

---

<div class="post-metadata">

**Author:** ![scarlyon](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@scarlyon](https://forums.balena.io/u/scarlyon)\
**Post date:** [November 15, 2019, 10:12pm UTC](https://forums.balena.io/t/nvidia-drivers-on-intel-nuc/2903/58 "2019-11-15T22:12:03Z")

</div>

> [@scarlyon](#):
>
> es\_headers.tar.gz && rm -rf kernel\_modules\_headers.tar.gz RUN mkdir -p /lib/modules/${YOCTO\_VERSION}-yocto-standard RUN mv ./kernel\_modules\_headers /lib/modules/${YOCTO\_VERSION}-yocto-standard/build RUN ln -s /lib64/ld-linux-x86-64.so.2 /lib/ld-linux-x86-64.so.2 RUN apt-get update && apt-cache s

Yeah, 435 works!!!

Thanks for your help!

Really appreciated.

---

<div class="post-metadata">

**Author:** ![thgreasi](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/thgreasi/32/454_2.png) [@thgreasi](https://forums.balena.io/u/thgreasi)\
**Post date:** [November 16, 2019, 12:28am UTC](https://forums.balena.io/t/nvidia-drivers-on-intel-nuc/2903/59 "2019-11-16T00:28:19Z")

</div>

We are glad to hear that it worked for you.  
Let us know if you need any further assistance.

---

<div class="post-metadata">

**Author:** ![jason10](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/jason10/32/1464_2.png) [@jason10](https://forums.balena.io/u/jason10)\
**Post date:** [February 12, 2020, 1:02pm UTC](https://forums.balena.io/t/nvidia-drivers-on-intel-nuc/2903/61 "2020-02-12T13:02:38Z")

</div>

@scarlyon, Shane, what is the exact hardware you are using? We were using Zotac mini pc with Nvidia GPU but didn’t try this build path.

---

<div class="post-metadata">

**Author:** ![scarlyon](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@scarlyon](https://forums.balena.io/u/scarlyon)\
**Post date:** [October 4, 2020, 5:09am UTC](https://forums.balena.io/t/nvidia-drivers-on-intel-nuc/2903/63 "2020-10-04T05:09:59Z")

</div>

@thgreasi@headss@shaunmulligan@pdcastro@zubairlk

I cannot install nvidia driver on the latest balenaOS now…

> [@Enable GPU on Container](https://forums.balena.io/t/enable-gpu-on-container/194366):
>
> We have been using this approach to install nvidia drivers inside the containers - [NVIDIA drivers on Intel Nuc](https://forums.balena.io/t/nvidia-drivers-on-intel-nuc/2903) But current HOST OS version(balenaOS 2.50.1+rev1) doesn’t seem to support nvidia-driver-435 any more. FROM balenalib/%%BALENA\_MACHINE\_NAME%%-ubuntu-python:3.6-bionic-build ENV RESINOS\_VERSION=2.50.1%2Brev1.prod ENV DEBIAN\_FRONTEND=noninteractive ENV YOCTO\_VERSION=5.2.10 RUN wget https://files.resin.io/images/intel-nuc/${RESINOS\_VERSION}/kernel\_modules\_headers.tar.gz RUN tar -xf kern…

Something is changed?

[Previous page](https://forums.balena.io/t/nvidia-drivers-on-intel-nuc/2903.md?page=1)
