Cycles CUDA not working on headless server

A couple of months ago I set up a headless server in my basement running Ubuntu, and everything was working fine.

Today I boot it up, update it, and suddenly I can’t render using the GPU any more.

When I run this script:
import bpy

prefs = bpy.context.user_preferences.addons[‘cycles’].preferences
devices = prefs.devices
print(prefs.compute_device_type)

for d in devices:
print(d.name)

the output is:

NONE
AMD FX™-6350 Six-Core Processor
GeForce GTX 970 (Display)

What can I do to fix this? Considering it worked before, I’m not really sure where to start looking and digging around.

Is it possible your update went from like 2.78 to 2.79? If you were getting Blender from your Linux distro, some of them run really far behind on versions.

From your output, doesn’t that suggest it knows about the CPU and GPU but that the currently configured GPU Compute option is “None”? That might happen if you lost your config file or it’s now looking for a 2.79 config file when you only have an old 2.78 one etc.

Can you VNC (or whatever) into the box and run Blender to verify/set the configuration correctly?

I was trying to use VNC but was running into a missing GLX extension error when I tried to start Blender (only when I try to start through VNC though).

The only solution that I know of atm would be to move the server upstairs and configure it here, but due to this being a problem that could happen frequently, I would rather be able to do this remotely in case it happens again. Is there any way to check / set GPU device through python or command line?