12
$\begingroup$

I would like to render with Cycles on a headless machine, without an X-server.

Has anyone done this with success?

I am getting the following error on Linux using Blender 2.78a:

$: blender -b cube.blend -E CYCLES -x 1 -o cube -f 1
terminate called after throwing an instance of 'OCLRT::xcb_error'
  what():  XCB ERROR: X session is not running!
Read new prefs: /home/mbomba/.config/blender/2.78/config/userpref.blend
read blend: /home/mbomba/Documents/art/3d/cube.blend

Update:
To clarify, this works fine if executed in a terminal when an X session is running. I'm wondering if it's a bug -- I was thinking about automating a cluster to render animations but the X dependency is kind of raining on my parade.

Update 2:
I compiled a version of Blender using the WITH_HEADLESS flag and I get the same error when I run it without X.

Update 3:
While I haven't been able to assimilate any of this information into a coherent solution, after some research I found that people encountered the same error occurs frequently with Beignet / Intel OpenCL driver installations.

Update 4:
I tested this via ssh on another machine and it works fine. It must be a problem specific my system. I would like to know what library is causing this issue, but I plan to do most of my rendering on the other machine anyhow.

SOLUTION

As sambler suggested in the comment, changing set(WITH_CYCLES_DEVICE_OPENCL TRUE) to set(WITH_CYCLES_DEVICE_OPENCL FALSE) in intern/cycles/CMakeLists.txt prior to building allowed me to render with Cycles in a tty. The issue must be related to the OpenCL drivers on my system.

$\endgroup$

2 Answers 2

2
$\begingroup$

It has been a while but I have rendered on a headless machine. I did have Xorg installed to be able to run x11 apps remotely but the was no running X-server on the remote machine.

If you want to get blender running without any X-server software installed then you will most likely have to compile your own version of blender. There is an option to build WITH_HEADLESS that will disable all dependencies on Xorg libraries.

$\endgroup$
4
  • $\begingroup$ I think this is on the right track. I attempted to compile Blender WITH_HEADLESS and the Python scripts were missing (crash and burn). Going to attempt to compile with PYTHON_MODULE instead of PYTHON_INSTALL and see if that changes anything. $\endgroup$
    – m88
    Commented Dec 8, 2016 at 21:51
  • $\begingroup$ Those were just path config errors, it turns out. The WITH_HEADLESS flag didn't work, on its own -- that disabled the GUI but Cycles crashes with the same XCB_ERROR in a tty. $\endgroup$
    – m88
    Commented Dec 9, 2016 at 0:21
  • $\begingroup$ I don't see it available to disable in ccmake but intern/cycles/CMakeLists.txt contains set(WITH_CYCLES_DEVICE_OPENCL TRUE) you could try changing that to FALSE before building. Do you have WITH_CYCLES_OPENSUBDIV enabled? opensubdiv can use a gpu through cuda or glsl as well as opencl for acceleration. $\endgroup$
    – sambler
    Commented Dec 10, 2016 at 1:42
  • $\begingroup$ Yes, a build without Cycles OpenCL did the trick -- good eye. $\endgroup$
    – m88
    Commented Dec 10, 2016 at 7:24
0
$\begingroup$

See my example with one frame and myfile.blend - is a blend file with a video animation video and sound and one cube:

C:\Users\myuser\Desktop>blender.lnk --background c:\temp\myfile.blend
--render-output C:\tmp\ --render-frame 10 -E CYCLES -x 1 -o cube -f 1
Read new prefs: C:\Users\myuser\AppData\Roaming\Blender Foundation\Blender\2.7
8\config\userpref.blend
AL lib: (EE) UpdateDeviceParams: Failed to set 48000hz, got 44100hz instead
found bundled python: C:\Program Files\Blender Foundation\Blender\2.78\python
read blend: c:\temp\myfile.blend
Fra:10 Mem:21.39M (0.00M, Peak 32.26M) | Time:00:00.00 | Sce:  Ve:0 Fa:0 La:0
Fra:10 Mem:21.39M (0.00M, Peak 32.26M) | Time:00:00.00 | Sce:  Ve:0 Fa:0 La:0
Append frame 10
 Time: 00:00.13 (Saving: 00:00.13)

Error: Could not open file for writing

Blender quit

Even this told me is on error I have output rendered.

I try with just one frame to test your issue.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .