Allow selection of GPU in headless.
Merge pull request #3739 from unknownbrackets/headless

Allow selection of GPU in headless