[Bf-cycles] Proposal for Compute Device Selection from Blender

Lukas Stockner lukas.stockner at freenet.de
Sat Nov 5 02:26:35 CET 2016


Hi!

This mail is about a proposal regarding how the user selects the used compute device in Cycles from Blender.



Basically, there are three problems with the current approach:

1. The Selection is hardcoded into Blender's core and uses a Cycles C API which feels, at least to me, more like a temporary hack

2. The Selection is only accessible through the User Preferences, which is pretty annoying when one wants to change it regularly.

3. It is only possible to select an individual GPU or all of them, a more fine-grained control would be nice.



But, I think it's possible to solve this rather easily (for Blender 2.8, due to compatibility):

1. Use the Cycles Addon user properties to store the settings, instead of the general user preferences.

2. From Python code, add a boolean property for each available compute device.
Due to the weird symbols in some device names and the possibility of duplicate names, I'd suggest 1. adding a incrementing index to the name of identical devices and 2. hashing it and using the first ~8 characters as the property name.

3. Add a "Compute Device" panel to the Render Property tab that displays a toggle button for every device, divided into sections by type. This could also be used for finer Network Rendering Server selection in the future.

4. Change the current Scene property that defines the used device so that it differentiates between CUDA and OpenCL, which allows to get rid of the Device Type property in the user properties.

5. Detect from Python code when no boolean device property is defined yet, and initialize them based on the old user preference options in that case to provide backwards compatibility (though not forward compatibility, but it's 2.8 after all).



From a coder's point of view it's not really great to show User Properties in the regular scene properties, but from a user and usability perspective it makes much more sense (to me).

The actual changes needed for this are pretty small (as far as I can see), but maybe there are any problems I missed?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
Url : http://lists.blender.org/pipermail/bf-cycles/attachments/20161105/a4aaed52/attachment.pgp 


More information about the Bf-cycles mailing list