diff --git a/tests/python/gpu_info.py b/tests/python/gpu_info.py index 65f0ef22c6d..c0123dbfdf7 100644 --- a/tests/python/gpu_info.py +++ b/tests/python/gpu_info.py @@ -8,7 +8,6 @@ Prints GPU back-end information to the console and exits. Use this script as `blender --background --python gpu_info.py`. """ import bpy -import gpu import sys # Render with workbench to initialize the GPU backend otherwise it would fail when running in @@ -19,6 +18,8 @@ scene.render.resolution_y = 1 scene.render.engine = "BLENDER_WORKBENCH" bpy.ops.render.render(animation=False, write_still=False) +# Import GPU module only after GPU backend has been initialized. +import gpu print('GPU_VENDOR:' + gpu.platform.vendor_get()) print('GPU_RENDERER:' + gpu.platform.renderer_get())