New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot affect GPU to task #10
Comments
That's a good idea, and CPU affinity too. I'm thinking that since there are so many Deadline options I should add a general "additional options" field where you can input key / value combinations that correspond to Deadline options. That way it would keep the main UI relatively clean with the most common options but give you the ability to add less common options as well. Do you think that would be a useful feature, or would you rather have it as an explicit option in the UI? |
Hi, I think it depends a lot of workflows As i use CPU and GPU affinity (sometimes both at the same time) for almost every dispatch, In my case it's a common option so to me it should be static |
Hello, I have made some try to implement this, without success sadly (i have tried to mimic the redshift one) |
Hey @Kaiz3rTool I didn't forget about your request! I'm not entirely sure how to implement this because I'm not familiar with the use case of GPU / CPU affinity. It looks like it's not common to all Deadline jobs but only certain plugins like Redshift, Nuke and some others. How are you running Redshift from Gaffer? Is it through a SystemCommand or PythonCommand? Or something else? |
Hey, i don't run redshift on gaffer, I was trying to understand how GPU affinity works in redshift's deadline plugin to join it to the gaffer one but it's too complicated to me sadly |
@Kaiz3rTool, following up on this and your post on the Deadline forum. As far as I can tell, GPU and CPU affinity are specific to the renderer you are using, so supporting it will depend on how you render through Gaffer. You can use the new custom environment variables in GafferDeadline, or you can bake it into the command itself. If you are using a Here's a very rough template you an copy and paste into Gaffer to try and explain my thoughts a little better. import Gaffer Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 0, persistent=False ) __children = {} __children["SystemCommand"] = GafferDispatch.SystemCommand( "SystemCommand" ) del __children |
It looks like Deadline / Redshift set an environment variable called import Gaffer Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 0, persistent=False ) __children = {} __children["SystemCommand"] = GafferDispatch.SystemCommand( "SystemCommand" ) del __children |
Hi Eric, |
Ah, I get it now. I don't know how Arnold does the GPU settings, it looks like the version currently shipping with Gaffer still leaves it as experimental. But it may be similar to Cycles with a little luck. I don't have multiple GPU configurations to test on unfortunately but give this a go: With Cycles I think it might be pretty straightforward. In the CyclesOptions node I think you can set the You may need to replace the Then in GafferDeadline, add a new environment variable called |
hi eric, and so on... from what i can see in redshift deadline plugins (in Redshift.py), the interesting part to talk to deadline is :
that correspond to the panel : |
I see, that is a much more clever use that I didn't know they did for Redshift. Thanks for that really good explanation. My thought is to change the GafferDeadline plugin (on the Deadline side) to add the GPU thread and CPU thread as environment variables set before Gaffer launches. Then you could create an expression for the GPU device to mimic what Deadline does to assign GPU threads to GPU devices. That would be pretty simple on my end and I think a great addition so I'll put it on my list for next week. In the meantime if you are rendering multiple frames you may be able to get by with a modulo expression setting the GPU device based on frame number? |
thanks Eric, sounds great ! thank you I have made some search in plugins/"mayabatch.py" to see how gpu per task is done, it seems that the process is to create a gpu override with specific renderer's flag to lock on GPU (descriptions for arnold , didn't found for blender for now ) then populate the scriptBuilder en let deadline handle the gpu assigment. bests Thanks ! |
I found this on the Deadline blog that gives a good explanation: https://www.awsthinkbox.com/blog/cpu-and-gpu-affinity-in-deadline. Depending on how your jobs typically come out you can
I take that to mean that if a task errors, when it's picked up by the next available worker it gets assigned whichever GPU is available. It would also work in the case of some frames being faster to finish than others - the next worker just takes whatever thread / GPU is assigned to it and it should utilize your full set of GPUs pretty well. And luckily for us with either of those methods I can just pass Deadline the GPU thread we're given into Gaffer and then it can be given to the renderer to handle appropriately. |
that's great, I use case 2 most of the time and sometimes both at the same times for very fast tasks |
Hey @Kaiz3rTool, give the latest release a try, I think it should sort out your GPU affinity: https://github.com/hypothetical-inc/GafferDeadline/releases/tag/0.54.0.0 If you are using the second method from that blog post, I think you'll need to actually use the environment variable
Or if you can only use one GPU for rendering at a time, I expect you can just use the |
Hey @ericmehl about the second method (multiple task with 1 GPU per task), I don't get it, sorry thanks |
Sorry, I was a little unclear in the quoted code. That is from the Redshift example you posted earlier. If you only want one GPU per task, you can ignore the
So if your single Worker is launching 4 different tasks, each will have a single If you want multiple GPUs per task, you can add a variable called
That will give you a list of GPU numbers to use for that task in Apologies if any of that code isn't quite right, but it should be pretty close. |
hi Eric, thanks for your help ! |
No worries, I'm glad it's working! |
Hi,
actually we don't have any GPU options from gafferDeadline submitter
could be great to add the "gpu affinity" options to attribute a specific number of GPUs per task
then we can use gafferCycles (or openGL render) with multiple GPU
bests
The text was updated successfully, but these errors were encountered: