Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,14 @@ def prune_frozen_root(root_path, patterns):
from installer.windows_ffmpeg import stage_ffmpeg_runtime
for frozen_path in os.listdir(build_path):
if frozen_path.startswith("exe") and ".previous-" not in frozen_path:
stage_ffmpeg_runtime(os.path.dirname(ffmpeg_bin_path), os.path.join(build_path, frozen_path))
package_root = os.path.join(build_path, frozen_path)
stage_ffmpeg_runtime(os.path.dirname(ffmpeg_bin_path), package_root)
if artifact_path:
for dll_name in ("libopenshot.dll", "libopenshot-audio.dll"):
dll_source = os.path.join(artifact_path, "bin", dll_name)
if os.path.isfile(dll_source):
log.info("Staging artifact DLL: %s", dll_source)
copy(dll_source, os.path.join(package_root, "lib", dll_name))

elif sys.platform == "linux":
# Linux issues with frozen folder
Expand Down
7 changes: 7 additions & 0 deletions installer/version_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,17 @@ def write_build_metadata(version_path, version_info, environ=None):
"""
environ = os.environ if environ is None else environ
metadata = dict(version_info)
metadata.setdefault("date", f'{datetime.datetime.now():%Y-%m-%d %H:%M}')
if not any(isinstance(metadata.get(project), dict) and metadata[project]
for project in ("openshot-qt", "libopenshot", "libopenshot-audio")):
metadata["build_type"] = "local"
metadata["official_distribution"] = (
environ.get("CI_SERVER_HOST") == "gitlab.openshot.org"
and environ.get("CI_PROJECT_PATH") == "OpenShot/openshot-qt"
)
branch = environ.get("CI_COMMIT_REF_NAME", "")
if environ.get("CI_PIPELINE_ID") and branch and branch != "develop" and not branch.startswith("release"):
metadata["build_type"] = "test"
with open(version_path, "w", encoding="utf-8") as stream:
json.dump(metadata, stream, indent=4)

Expand Down
46 changes: 9 additions & 37 deletions src/classes/gpu_diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,51 +248,23 @@ def copy_lines(self):
if device is None:
device = next((d for d in state["devices"] if d["type"] != "software"), None)
lines = ["GPU: " + (device["name"] if device else "not identified")]
previews = state["previews"]
native = sum(p["native_draws"] for p in previews)
cpu = sum(p["cpu_draws"] for p in previews)
if not state["apis"]["ListGpuDevices"]:
status = "GPU acceleration unavailable in this build"
status = "Unavailable in this build"
elif state["backend"] == "cpu":
status = "CPU rendering was explicitly requested"
elif native and cpu:
status = "GPU acceleration worked, but CPU fallback also occurred"
elif native:
status = "GPU acceleration used for preview"
elif cpu:
status = "CPU preview used; GPU presentation did not succeed"
elif previews and not any(p["enabled"] for p in previews):
status = "CPU preview selected"
status = "CPU mode explicitly selected"
elif state["probe"] != "complete":
status = "Checking whether GPU acceleration is available"
status = "Checking capabilities"
elif state["selected"]:
status = "GPU acceleration available; not yet used for preview"
status = "Available"
else:
status = "No usable Vulkan device"
lines.append("Preview: " + status)
status = "Unavailable"
lines.append("GPU Support: " + status)
driver_line = None
if device:
driver_line = "Driver: %s | Vulkan: %s" % (device["driver"] or "not reported", device["vulkan_api"])
if state["backend"] != "cpu":
# Prefer the timeline's explanation; keep additional previews and
# earlier reasons in the detailed report rather than the clipboard.
reasons = []
for preview in sorted(state["previews"], key=lambda p: p["name"] != "timeline"):
if preview["fallback_reasons"]:
reasons.append(preview["fallback_reasons"][-1])
elif not preview["enabled"]:
reasons.append(preview["selection_reason"])
if reasons or state["errors"]:
reason = (reasons or state["errors"])[0].splitlines()[0]
if "selected different GPUs" in reason:
reason = "Display and video processing selected different GPUs"
elif reason.startswith("Frame is CPU-backed"):
reason = "This preview needed CPU image data"
elif reason == "Qt could not create a usable OpenGL context":
reason = "Display initialization could not enable GPU preview"
elif reason == "libopenshot has no Vulkan presenter binding":
reason = "This build does not provide GPU preview support"
lines.append("Fallback reason: " + (reason[:237] + "…" if len(reason) > 240 else reason))
if state["backend"] != "cpu" and not state["selected"] and state["errors"]:
reason = state["errors"][0].splitlines()[0]
lines.append("GPU initialization: " + (reason[:237] + "…" if len(reason) > 240 else reason))
if driver_line:
lines.append(driver_line)
debug = ["%s=%s" % (key, self.environ[key]) for key in DEBUG_VARIABLES if self.environ.get(key)]
Expand Down
7 changes: 7 additions & 0 deletions src/classes/release_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ def get_build_details():
with open(path, encoding="utf-8") as stream:
metadata = json.load(stream)
if isinstance(metadata, dict):
# Downstream packages may supply partial or differently shaped data.
for project in ('openshot-qt', 'libopenshot', 'libopenshot-audio'):
if project in metadata and not isinstance(metadata[project], dict):
metadata[project] = {}
for key in ('build_name', 'date', 'build_type'):
if key in metadata and not isinstance(metadata[key], str):
metadata.pop(key)
return metadata
except FileNotFoundError:
pass
Expand Down
Loading
Loading