How to disable Global Illumination at runtime

In my standalone windows player I am using Global Illumination in one of my scenes. The player has to run either in normal or in headless (-batchmode -nographics) mode. In headless mode the player throws the following error:

Error: Global Illumination requires a graphics device to render albedo.

Since I cannot (for reasons I don’t want to detail here) do without Global Illumination I am looking for a workaround, such as disabling Global Illumination at startup. However I was not successful in doing so. I tried disabling all lights in my scene on Awake, but it did not help. Neither can I access the illumination settings of my scene, or at least can’t find where to do this. Does anyone have an idea how to solve this?

I am using Unity 5.6.2.

There’s an asset called Headless Builder, which not only fixes the error you mentioned, but also skips light baking and other stuff for headless builds.