So you should checkout difference between computers that use GPU and that use CPU.
But it seems that Blender needs a GUI session to use GPU (very pity).
May be all your ms windows afrenders runs within a GUI session?
And some Linuxes runs afrenders from init.d or systemd daemon with no GUI?
If so, you should write to Blender developers, other soft that uses GPU do not need a GUI session.
- what we should do with a cloud rendering? cloud with a GUI session is much more complex.
GPU rendering on linux
Re: GPU rendering on linux
Timur Hairulin
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
-
- Posts: 16
- Joined: Fri Jan 11, 2019 2:43 pm
Re: GPU rendering on linux
Sory for my quite poor english.
It looks like its not blender itself.
This is rendering on CGRU. (look at cpu and gpu utilisation)
And this is same command copied to terminal- so rendering without gui. Also i heard that blender works on AWS cloud withoud problem.
This is all done on one computer. So it seems that its cgru issue not blender itself...
It looks like its not blender itself.
This is rendering on CGRU. (look at cpu and gpu utilisation)
And this is same command copied to terminal- so rendering without gui. Also i heard that blender works on AWS cloud withoud problem.
This is all done on one computer. So it seems that its cgru issue not blender itself...
Re: GPU rendering on linux
"And this is same command copied to terminal- so rendering without gui"
- Terminal launched from GUI have a GUI. I see you screenshot - that terminal with a GUI.
In that terminal type:
- So that afrender client will be with GUI.
And check how it works.
- Terminal launched from GUI have a GUI. I see you screenshot - that terminal with a GUI.
In that terminal type:
Code: Select all
cd /opt/cgru
source ./setup.sh
afrender
And check how it works.
Timur Hairulin
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
-
- Posts: 16
- Joined: Fri Jan 11, 2019 2:43 pm
Re: GPU rendering on linux
jesus... it works that way.
Thank you very much
I'll make this as my workaround then....
What should i exacly write to blender devs to make them aware of issue?
Thank you very much
I'll make this as my workaround then....
What should i exacly write to blender devs to make them aware of issue?
Re: GPU rendering on linux
At first you should ask:
- Can I render using GPU running Blender command line with no display? If I can, how to do it?
(may be we are doing something wrong)
- Can I render using GPU running Blender command line with no display? If I can, how to do it?
(may be we are doing something wrong)
Timur Hairulin
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
Re: GPU rendering on linux
Found this thread when looking for why is afrender not able to use GPU. I belive this has something to do to the lack of permissions of the "render" user that is used by the afrender service. It works when you run it with the way that timurhai posted as it is using the user you are currently logged in with. Can you change the user that the afrender service runs with?
Re: GPU rendering on linux
Hi!
If you are using Linux packages - you can tune SystemD service settings.
There are lots of manuals for this.
If you are using Linux packages - you can tune SystemD service settings.
There are lots of manuals for this.
Timur Hairulin
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
Re: GPU rendering on linux
For anyone else still dealing with this problem:
Automatic GPU detection was deactivated in headless mode, since it could lead to crashes on startup.
See:
https://devtalk.blender.org/t/headless- ... us/12176/3
The solution is to run GPU detection after loading your file; specifically
This can be done via a small add-on or with a registered script from within the .blend file (this could even be linked in from a central file; depending on your pipeline).
This snippet worked perfectly for me (taken from https://blender.stackexchange.com/a/154512 and edited):
Hope that helps!
All the best,
-Tristan
Automatic GPU detection was deactivated in headless mode, since it could lead to crashes on startup.
See:
https://devtalk.blender.org/t/headless- ... us/12176/3
The solution is to run GPU detection after loading your file; specifically
Code: Select all
bpy.context.preferences.addons['cycles'].preferences.get_devices()
This snippet worked perfectly for me (taken from https://blender.stackexchange.com/a/154512 and edited):
Code: Select all
import bpy
def activate_cuda_devices(context, cpu=True, gpu=True):
"""
Update CUDA devices and activate them based on parameters
"""
cycles_preferences = context.preferences.addons['cycles'].preferences
cuda_devices, opencl_devices = cycles_preferences.get_devices()
cycles_preferences.compute_device_type = 'CUDA'
for device in cuda_devices:
if (cpu and device.type == 'CPU') or (gpu and device.type == 'CUDA'):
print(f'Activating {device.name}')
device.use = True
else:
print(f'Deactivating {device.name}')
device.use = False
activate_cuda_devices(bpy.context, cpu=True, gpu=True)
All the best,
-Tristan