jamesyonan / brenda

Blender render farm software for Amazon Web Services
Other
246 stars 67 forks source link

GPU #11

Open random-robbie opened 10 years ago

random-robbie commented 10 years ago

Hi,

Does this also work on the GPU clusters at all?

g2.2xlarge

looking for a fairly quick way of rendering a project of around 250 frames

djoxy commented 10 years ago

If you mean to render using Nvidia GPU yes it works but you will have to add a option to the blender command line (task).

-P cuda_setup.py

EXAMPLE:

blender -b project.blend -o //finished/render -F PNG -x 1 -P cuda_setup.py -s 50 -e 110 -a

You have to create file cuda_setup.py (via notepad ++) with this content:

import bpy bpy.context.user_preferences.system.compute_device_type = 'CUDA' bpy.context.user_preferences.system.compute_device = 'CUDA_MULTI_2'

This basically sets up the blender to use the GPU for rendering.

CUDA_MULTI_2 is the name for the Amazon instance with dual Tesla GPU.

Only thing I cant recall is how to get this name for other type of nvidia cards and you have to set it up before going.

Hope I was clear enough.

Best regards

random-robbie commented 10 years ago

Thank you for your help I will try this with my next little project!

Amazing work! keep it up!

random-robbie commented 10 years ago

forgot to ask did you see any major speed improvement with this?

djoxy commented 10 years ago

I just notice that prices for this GPU spot instances where down by a big numbers since last time I was using GPU instance.

I think this is a game changer. My guess is that those GPU instances are more then 10 times faster then CPU and price is around $0.07 now. Which was the original price for CPU instance when Brenda was created.

random-robbie commented 10 years ago

brilliant i currently have

c3.8xlarge c3.4large c3.xlarge c3.xlarge

running at the moment so on my next project i will do the cuda side.

you should add the cuda options in to the main readme.

once again thanks for your help

djoxy commented 10 years ago

Hey I am not a developer. I only researched this so I can use it for rendering of my projects :). Basic Brenda user here.

Welcome

Best regards

random-robbie commented 10 years ago

you've done really well i am just firing up instances to get it done quicker :)

i will let you know how i get on with the cuda.

random-robbie commented 10 years ago

currently getting HVM required for g2.2xlarge any ideas?

random-robbie commented 10 years ago

hate to ask could you create a AMI for the GPU at all? i am struggling to get it all working correctly.

djoxy commented 10 years ago

You don't have to create special AMI for GPU. You just have to tell current AMI to use the CUDA for rendering instead of CPU via script I send you. Only problem is that path to the script should be available for rendering machine. What I did is that I put that script on the S3 where rendered output files are so it is accessible by a Brenda rendering node.

djoxy commented 10 years ago

By the way, you can update Blender on the AMI to current one 2.72. What you have to do is start that ami on one machine then update blender and then create new AMI from that running machine. You will have to change AMI name in the Brenda configuration too so Brenda use it instead of old one.

random-robbie commented 10 years ago

i tried to run the brenda AMI on a GPU cluster and cause the AMI is PV and not HVM it wont run it. I kept getting an error stating it needed to be HVM

djoxy commented 10 years ago

I see now. This is new. So we have to build new fresh AMI that supports HVM

djoxy commented 10 years ago

Where you struggle?

random-robbie commented 10 years ago

it just would not connect with any of the nodes.

i also think that i done the frame rate template wrong.

current file it is:

blender -b *.blend -o //finished/render -F AVI_JPEG -x 1 -P cuda_setup.py -s $START -e $END -j $STEP -t 0 -a

djoxy commented 10 years ago

This was my template:

blender -b /mnt/s3/project.blend -o //finished/animation -F PNG -x 1 -P /mnt/s3/py/cuda_setup.py -s 50 -e 110 -a

random-robbie commented 10 years ago

do you have skype at all? easier to chat than bomb your github? add me robbie@xcellweb.co.uk

Berryu commented 10 years ago

I'm also having problems with the HVM error. Did you guys already solved the problem?

random-robbie commented 10 years ago

driver issues with the GPU under ubunut i think is the issue.

djoxy commented 10 years ago

Yes. Drivers for nvidia K520 and CUDA. Since Robby and me aren't that Linux proficient.

Berryu commented 10 years ago

Wait, I'm confused. Is it fixable or not?

djoxy commented 10 years ago

Yes by someone who knows how to do it properly...

Berryu commented 10 years ago

Doesn't that just mean that we need to make a custom IMA with the new drivers?

Berryu commented 10 years ago

Hey guys,

I'm glad to tell you that I found a way to use the gpu. You will have to launch a g2.2xlarge instance via the aws marketplace with the nvidia grid drivers preinstalled. After loggin in with ssh you need to create a custom IMA via the instructions James has written at the bottom of the page.

Just one problem, after rendering for one hour. It seems that the nvidia grid doesn't render, but the 8 cpu cores of the instance.

How to fix this?

edit: Forgot to mention that you have to configure the custom instance id in the blenda.conf file.

Berryu commented 10 years ago

Any luck?

djoxy commented 9 years ago

Hey Berry,

Sorry to say this but that way you did nothing. You just used AMI with NVIDIA drivers but still rendered via CPU. Blender by default use CPU for rendering until its ordered to use CUDA/GPUs. And here is the way to do that: http://www.dalaifelinto.com/?p=746

The problem I faced today is that I used an AMI (Ubuntu 14.04 x64) with Nvidia drivers and CUDA 6.5 already installed but for some reason Blender 2.72 does not see the cards (2xTesla). And that worked year ago (on Windows). Sadly this is out of my proficiency. Bottom line is:

We have:

  1. AMI with Nvidia drivers and CUDA 6.5 preinstalled
  2. Latest Blender 2.72b installed
  3. Brenda installed
  4. Script that force Blender to use GPU for rendering

If someone can fix and find the reason why Blender does not see the cards that would solve our problems.

Thanks

P.S. Public community AMI with NVIDIA and CUDA: http://tleyden.github.io/blog/2014/10/25/cuda-6-dot-5-on-aws-gpu-instance-running-ubuntu-14-dot-04/

djoxy commented 9 years ago

Okay, I have managed it working and just realized that GPU isn't worth for a bucks. The limit of GPU instances is only 5. They do render double faster then using CPU but you can arise 45 more CPU machines.

hardbyte commented 9 years ago

Using favourable spot prices in North Virginia one can run GPU instances for between 5 and 10 cents per hour. In EC2 Management console there is a section Limits where I needed to put in a request to be allowed more than 5 g2.2xlarge instances but Amazon came back with an approval the same day for 40 machines.

Getting Blender going with the GPU instances took some fiddling so I've created a public AMI which you can use. Substitute the AMI with my image which has CUDA enabled and Blender 2.74 installed:

North Virginia (us-east-1): ami-7207351a Sydney (ap-southeast-2): ami-9f5220a5

Use a frame-template with the addition -P /opt/cuda\_setup.py:

brenda-work -T frame-template -s 1 -e 1 push

Note if you don't include -P /opt/cuda_setup.py it will still run but will use the CPU instead of GPU. Tip run nvidia-smi to see GPU utilization during rendering. Note the AMI is based on StarCluster which uses Ubuntu 12.04 as the underlying operating system. Blender 2.73 is also present under /opt/blender-2.73.

Cross posted to my blog - http://bitsofpy.blogspot.com.au/2015/04/amazon-blender-274.html

djoxy commented 9 years ago

Thank you very much!