Coder Social home page Coder Social logo

Says done before logs says 100%? about upscayl HOT 6 OPEN

zhilinli1 avatar zhilinli1 commented on September 13, 2024
Says done before logs says 100%?

from upscayl.

Comments (6)

dosubot avatar dosubot commented on September 13, 2024 2

Hello, @zhilinli1! I'm here to help you with any bugs, questions, or contributions you have regarding Upscayl. Let's work together to resolve this issue!

The app says upscaling is done before the logs show 100% because the onClose event is triggered when the upscaling process closes, not necessarily when the progress reaches 100%. This can result in the process being marked as complete and the notification being shown even if the progress bar hasn't reached 100%, leading to a broken image and the file not being saved correctly.

Here is the relevant code snippet:

const onClose = () => {
  if (!mainWindow) return;
  if (!failed && !stopped) {
    logit("💯 Done upscaling");
    upscayl.kill();
    mainWindow.webContents.send(
      COMMAND.FOLDER_UPSCAYL_DONE,
      outputFolderPath,
    );
    if (!encounteredError) {
      showNotification("Upscayled", "Images upscayled successfully!");
    } else {
      showNotification(
        "Upscayled",
        "Images were upscayled but encountered some errors!",
      );
    }
  } else {
    upscayl.kill();
  }
};

The onClose event handler is executed when the upscaling process closes, which might happen before the progress reaches 100%. Additionally, the window.electron.on(COMMAND.UPSCAYL_PROGRESS, ...) event listener updates the progress state, but if the process closes prematurely, the progress might not reach 100%, causing the issue.

Here is the relevant part of the event listener:

window.electron.on(COMMAND.UPSCAYL_PROGRESS, (_, data: string) => {
  if (data.length > 0 && data.length < 10) {
    setProgress(data);
  } else if (data includes "converting") {
    setProgress("Scaling and converting image...");
  } else if (data includes "Successful") {
    setProgress("Upscayl Successful!");
  }
  handleErrors(data);
  logit(`🚧 UPSCAYL_PROGRESS: `, data);
});

The progress state is updated based on the data received, but if the process closes before reaching 100%, the progress bar will not reflect the actual completion status [1][2][3].

To continue talking to Dosu, mention @dosu.

from upscayl.

dosubot avatar dosubot commented on September 13, 2024 2

To address the issue where Upscayl version 2.11.5 on Linux, running Windows 11 Pro for Workstations, 23H2, with an AMD Radeon 760M GPU, indicates that upscaling is done before the logs show 100%, resulting in a broken image and the file not being saved correctly, you can try the following fixes:

  1. Set the app to performance mode: Follow the instructions here to set the app to performance mode.

  2. DirectX repair: Try repairing DirectX by following the guide here.

  3. Disable switchable graphics: If applicable, disable switchable graphics by following the instructions here.

  4. Enable hardware-accelerated GPU scheduling: Enable hardware-accelerated GPU scheduling by following the guide here.

  5. Reinstall graphics drivers: Before reinstalling, run VulkanCapsViewer to check for Vulkan support. If Vulkan support is confirmed, you might not need to reinstall the drivers.

  6. Check Upscayl's internal logging and process handling: Ensure that the upscaling process is not prematurely terminated. The imageUpscayl function in Upscayl's codebase handles the upscaling process and logs progress. Make sure the onData, onError, and onClose event handlers are correctly implemented to handle the process lifecycle and log progress accurately. Specifically, the onClose event should only be triggered once the process is fully complete to avoid premature termination.

Additionally, you can monitor the progress and handle errors more effectively by leveraging the event listeners in Upscayl's codebase. For instance, the COMMAND.UPSCAYL_PROGRESS event updates the progress and handles errors, ensuring that the process is accurately tracked. If the issue persists, consider checking the logs for any specific errors related to GPU or file read/write permissions, as these are common culprits [1][2][3].

To continue talking to Dosu, mention @dosu.

from upscayl.

zhilinli1 avatar zhilinli1 commented on September 13, 2024

@dosu is there a hack/fix for this?

from upscayl.

github-actions avatar github-actions commented on September 13, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still happening, please reply to indicate so.

from upscayl.

zhilinli1 avatar zhilinli1 commented on September 13, 2024

from upscayl.

aaronliu0130 avatar aaronliu0130 commented on September 13, 2024

I think it might be due to how the 780M is a mobile GPU. Try the workaround in the README.

from upscayl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.