EGL failed to get devices with Nvidia driver 384.66

For anyone who stumbled upon this post as I do, the problem could be linking to the wrong EGL libraries. After I change the link path to the libraries in /usr/lib/nvidia-410 my code works.

Here are some more posts that are helpful: