If when running vcgencmd on a raspberry pi you get VCHI initialization failed then you need to add the video group to your user. The vcgencmd tool requires you have this group role so without it, it will give VCHI initialization failed.
To add the user group to your user you can run:
sudo usermod -aG video <username>
sudo usermod -G video www-data