Page MenuHome

RenderReport: Add option to add platform specific overrides.
ClosedPublic

Authored by Jeroen Bakker (jbakker) on Jun 22 2022, 9:56 AM.

Details

Summary

Reference images in the reference_override_dir will be chosen before
images in reference_dir. This allows platform specific reference
images, with a common base.

Ignored when set to None. The caller is responsible
of setting the reference override dir as the unit test is more aware
what the definition of a platform is.

Patch adds gpu.platform.device_type_get function to get the device
type that blender has detected.

Diff Detail

Repository
rB Blender
Branch
temp-T99046-platform-reference-images (branched from master)
Build Status
Buildable 22626
Build 22626: arc lint + arc unit

Event Timeline

Jeroen Bakker (jbakker) requested review of this revision.Jun 22 2022, 9:56 AM
Jeroen Bakker (jbakker) created this revision.

Renamed to reference override dir

Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Jun 22 2022, 9:59 AM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
  • Get GPU platform.
  • Added GPU info as script to solve initialization errors.
Brecht Van Lommel (brecht) requested changes to this revision.Jun 22 2022, 4:37 PM
Brecht Van Lommel (brecht) added inline comments.
tests/python/gpu_info.py
1 ↗(On Diff #52784)

It's not clear to me how the GPU backend gets initialized to be able to access the vendor.

4–6 ↗(On Diff #52784)

Code style: + -> + .

tests/python/modules/render_report.py
88–92

Rename platform to override for consistency.

90

Should be os.path.exists(platform_img)?

This revision now requires changes to proceed.Jun 22 2022, 4:37 PM
Jeroen Bakker (jbakker) marked 4 inline comments as done.

Added Python API for devce type.
Documented usage of gpu_info.
Removed references to platform.

tests/python/gpu_info.py
1 ↗(On Diff #52784)

The GPU backend is initialized when windows manager is initialized (hence I had to remove the --background parameter).
Also the --python-expr didn't work as expected.

Background rendering is working as draw manager detects and creates its own context. I found it to harmful to do a similar trick.

Will write a usage comment at the start of this script.

4 ↗(On Diff #52784)

The vendor string is platform dependent. It would be better to use eGPUDeviceType, eGPUOSType and eGPUDriverType to reuse code.

Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Jun 22 2022, 5:15 PM
Jeroen Bakker (jbakker) planned changes to this revision.Jul 22 2022, 10:08 PM
Jeroen Bakker (jbakker) marked an inline comment as not done.

I missed that this patch got updated. I didn't spot issues in the current implementation, though not sure what kind of changes you have planned.

Popping up a window while running the tests is not ideal, not sure how much that would get in the way in practice. Possibly you could do a tiny workbench render to initialize the GPU in background mode.

Found a bug where I missed a rename.

if os.path.exists(old_img):

@Brecht Van Lommel (brecht) thanks for the tip. Using a tiny workbench render is a good idea.

  • Fix issue using incorrect path.
  • Initialize GPU backend in background by rendering a 1x1 image.
This revision is now accepted and ready to land.Jul 26 2022, 2:51 PM
Jeroen Bakker (jbakker) marked an inline comment as done.Jul 28 2022, 8:41 AM