Skip to content

Generated Python script prevents blender from rendering, hangs instead

I'm using Arch Linux fully up to date, OpenJDK 15.0.2 (also tried 1.8.0 and 11.0.10), Sheepit client 6.20364.0, and no matter how long I leave it it always hangs on "Preparing scene 0%" on the "Can Blender be launched?" project.

It appears to be running blender as rend.exe however the process sits there doing nothing. I have tried clearing the cache file which makes no difference. It occurs whether I select CPU or GPU rendering.

I've noticed that running the command in the sheepit debug output without the -P /tmp/farm_##/script_## option immediately renders the file.

If I render the file and put it in the correct place (i.e. run blend.exe without the Python script), then SIGHUP rend.exe, the client continues to then try the machine strength test but fails with the same problem.

Debug output
$ java -jar sheepit-client-6.20364.0.jar --verbose
11-02 22:40:16 (debug) client version 6.20364.0
11-02 22:40:17 (debug) Server::getConfiguration url https://client.sheepit-renderfarm.com/server/config.php
11-02 22:40:17 (debug) Server::HTTPRequest url(https://client.sheepit-renderfarm.com/server/config.php)
11-02 22:40:18 (debug) Server::requestJob
11-02 22:40:18 (debug) Server::HTTPRequest url(https://client.sheepit-renderfarm.com/server/request_job.php?computemethod=0&cpu_cores=12&ram_max=12320768&rendertime_max=0&gpu_model=GeForce%20GTX%20970&gpu_ram=4230545408&gpu_type=CUDA)
11-02 22:40:19 (debug) Got work to do id: 1 frame: 0340
11-02 22:40:19 (debug) Server::HTTPRequest url(https://client.sheepit-renderfarm.com/server/archive.php?type=job&job=1)
11-02 22:40:19 (debug) File downloaded at 434.51MB/s, written 455617 bytes
11-02 22:40:22 (debug) Rendering bucket size set to 256x256 pixels
11-02 22:40:22 (debug) [/tmp/farm_6985551617001754415/05234503229a4660e428e8d227746d8d/rend.exe, -t, 12, --factory-startup, --disable-autoexec, -noaudio, -b, /tmp/farm_6985551617001754415/db26b54689516484633b7d4855fb1567/compute-method.blend, -P, /tmp/farm_6985551617001754415/script_13946925981295416816, --engine, CYCLES, -o, /tmp/farm_6985551617001754415/1_, -f, 0340, -x, 1]
11-02 22:40:22 (debug) renderer output
Blender output, if ran while Sheepit is hanging here (with debug output on)
$ /tmp/farm_6985551617001754415/05234503229a4660e428e8d227746d8d/rend.exe -t 12 --factory-startup --disable-autoexec -noaudio -b /tmp/farm_6985551617001754415/db26b54689516484633b7d4855fb1567/compute-method.blend -P /tmp/farm_6985551617001754415/script_13946925981295416816 --engine CYCLES -o /tmp/farm_6985551617001754415/1_ -f 0340 -x 1 --debug --debug-cycles --log-level 10 --verbose 10
Switching to fully guarded memory allocator.
Blender 2.90.1 (hash 3e85bb34d0d7 built 2020-09-23 08:34:47)
Blender 2.90.1
Build: 2020-09-23 08:34:47 Linux Release
argv[0] = /tmp/farm_6985551617001754415/05234503229a4660e428e8d227746d8d/rend.exe
argv[1] = -t
argv[2] = 12
argv[3] = --factory-startup
argv[4] = --disable-autoexec
argv[5] = -noaudio
argv[6] = -b
argv[7] = /tmp/farm_6985551617001754415/db26b54689516484633b7d4855fb1567/compute-method.blend
argv[8] = -P
argv[9] = /tmp/farm_6985551617001754415/script_13946925981295416816
argv[10] = --engine
argv[11] = CYCLES
argv[12] = -o
argv[13] = /tmp/farm_6985551617001754415/1_
argv[14] = -f
argv[15] = 0340
argv[16] = -x
argv[17] = 1
argv[18] = --debug
argv[19] = --debug-cycles
argv[20] = --log-level
argv[21] = 10
argv[22] = --verbose
argv[23] = 10
read file 
  Version 280 sub 39 date unknown hash unknown
found bundled python: /tmp/farm_6985551617001754415/05234503229a4660e428e8d227746d8d/2.90/python
I0211 22:45:02.664669 13023 blender_python.cpp:194] Debug flags initialized to:
CPU flags:
  AVX2       : True
  AVX        : True
  SSE4.1     : True
  SSE3       : True
  SSE2       : True
  BVH layout : EMBREE
  Split      : False
CUDA flags:
  Adaptive Compile : False
OptiX flags:
  CUDA streams : 1
OpenCL flags:
  Device type    : ALL
  Debug          : False
  Memory limit   : 0
Read blend: /tmp/farm_6985551617001754415/db26b54689516484633b7d4855fb1567/compute-method.blend
read file /tmp/farm_6985551617001754415/db26b54689516484633b7d4855fb1567/compute-method.blend
  Version 282 sub 7 date 2020-02-12 16:20 hash 77d23b0bd76f
I0211 22:45:02.673787 13023 device_cuda.cpp:41] CUEW initialization succeeded
I0211 22:45:02.673805 13023 device_cuda.cpp:43] Found precompiled kernels
I0211 22:45:02.676620 13023 device_cuda.cpp:170] Device is recognized as display.
I0211 22:45:02.676638 13023 device_cuda.cpp:179] Added device "GeForce GTX 970" with id "CUDA_GeForce GTX 970_0000:01:00".
I0211 22:45:02.677896 13023 device_opencl.cpp:48] CLEW initialization succeeded.
Python script file generated for CUDA/GPU
$ cat /tmp/farm_6985551617001754415/script_13946925981295416816 
import bpy
def sheepit_set_compute_device(device_type, device_family, device_id):
        # either CUDA, GPU, CUDA_0
        # or     NONE, CPU, CPU

        bpy.context.scene.cycles.device = device_family
        bpy.context.preferences.addons['cycles'].preferences.compute_device_type = device_type

        devices = bpy.context.preferences.addons['cycles'].preferences.get_devices() # 0 => cuda, 1 => opencl
        for i in range(len(devices[0])):
                devices[0][i].use = devices[0][i].id == device_id
        for i in range(len(devices[1])):
                devices[1][i].use = devices[1][i].id == device_id
import bpy

# bpy.context.scene.render.threads_mode = 'AUTO'

# if it's a movie clip, switch to png
fileformat = bpy.context.scene.render.image_settings.file_format
if fileformat != 'BMP' and fileformat != 'PNG' and fileformat != 'JPEG' and fileformat != 'TARGA' and fileformat != 'TARGA_RAW' :
        bpy.context.scene.render.image_settings.file_format = 'PNG'
        bpy.context.scene.render.filepath = ''

if bpy.context.scene.render.image_settings.file_format == 'PNG':
        bpy.context.scene.render.image_settings.compression = 100

try:
        bpy.context.scene.render.use_stamp_filename = False
        bpy.context.scene.render.use_stamp_date = False
        bpy.context.scene.render.use_stamp_hostname = False
        bpy.context.scene.render.use_stamp_memory = False
        bpy.context.scene.render.use_stamp_render_time = False
except AttributeError:
        pass

try:
        bpy.context.scene.render.threads_mode = 'AUTO'
except AttributeError:
        pass

sheepit_set_compute_device("CUDA", "GPU", "CUDA_GeForce GTX 970_0000:01:00")
bpy.context.scene.render.tile_x = 256
bpy.context.scene.render.tile_y = 256
import signal
def hndl(signum, frame):
    pass
signal.signal(signal.SIGINT, hndl)
Python script file generated for CPU
$ cat /tmp/farm_4983441202988305636/script_6787813479300415901
import bpy
def sheepit_set_compute_device(device_type, device_family, device_id):
        # either CUDA, GPU, CUDA_0
        # or     NONE, CPU, CPU

        bpy.context.scene.cycles.device = device_family
        bpy.context.preferences.addons['cycles'].preferences.compute_device_type = device_type

        devices = bpy.context.preferences.addons['cycles'].preferences.get_devices() # 0 => cuda, 1 => opencl
        for i in range(len(devices[0])):
                devices[0][i].use = devices[0][i].id == device_id
        for i in range(len(devices[1])):
                devices[1][i].use = devices[1][i].id == device_id
import bpy

# bpy.context.scene.render.threads_mode = 'AUTO'

# if it's a movie clip, switch to png
fileformat = bpy.context.scene.render.image_settings.file_format
if fileformat != 'BMP' and fileformat != 'PNG' and fileformat != 'JPEG' and fileformat != 'TARGA' and fileformat != 'TARGA_RAW' :
        bpy.context.scene.render.image_settings.file_format = 'PNG'
        bpy.context.scene.render.filepath = ''

if bpy.context.scene.render.image_settings.file_format == 'PNG':
        bpy.context.scene.render.image_settings.compression = 100

try:
        bpy.context.scene.render.use_stamp_filename = False
        bpy.context.scene.render.use_stamp_date = False
        bpy.context.scene.render.use_stamp_hostname = False
        bpy.context.scene.render.use_stamp_memory = False
        bpy.context.scene.render.use_stamp_render_time = False
except AttributeError:
        pass

try:
        bpy.context.scene.render.threads_mode = 'AUTO'
except AttributeError:
        pass

sheepit_set_compute_device("NONE", "CPU", "CPU")
bpy.context.scene.render.tile_x = 32
bpy.context.scene.render.tile_y = 32
import signal
def hndl(signum, frame):
    pass
signal.signal(signal.SIGINT, hndl)

Let me know if any other info would help solve this.