OpenCL segfault with NVIDIA 390.42 driver on Ubuntu 16.04

A segfault is triggered when clCreateContextFromType is called. The OpenCL is installed alongside CUDA 9.0.

Thread 1 “a.out” received signal SIGSEGV, Segmentation fault.
0x00007ffff5d1184d in ?? () from /usr/lib/x86_64-linux-gnu/libnvidia-opencl.so.1

The same program works well with NVIDIA driver and OpenCL in CUDA 8.0 package.