run headless linux server for video encoding (ffmpeg)

Hello

Not sure, if it’s the right place for my question. Anyway … I’m going to build an ubuntu 16.04 server that is able to transcode videos automatically when a video get’s uploaded.

Now I have two questions:
How do I have to configure the server that a geforce gtx 1060 card is working headless?
Does someone know a good howto for compiling ffmpeg so that ffmpeg can use the geforce gtx 1060 card for transcoding?

Kind regards, Roland