Giter Club home page Giter Club logo

Comments (2)

dhiltgen avatar dhiltgen commented on June 29, 2024

This may be a dup of #3511 - it appears there are some scenarios where laptops put Ollama in efficiency mode, which results in very poor performance. You should be able to workaround this in Task Manager by selecting the ollama processes and making sure they don't have the green leaf/efficiency mode selected.

from ollama.

fengbangyao avatar fengbangyao commented on June 29, 2024

Thank you for your attention ^.^
Yes, indeed, it's the efficiency mode that's causing the issue. , and it's not exclusive to laptops; I'm using a desktop.What I mean is, will the official team provide command-line support for this issue? For instance, Chrome or Edge already supports command-line control with --disable-features=UseEcoQoSForBackgroundProcess. I don't know the Go language, and the Chromium code is as follows:

bool Process::SetPriority(Priority priority) {
  DCHECK(IsValid());
  // Having a process remove itself from background mode is a potential
  // priority inversion, and having a process put itself in background mode is
  // broken in Windows 11 22H2. So, it is no longer supported. See
  // https://crbug.com/1396155 for details.
  DCHECK(!is_current());
  const DWORD priority_class = priority == Priority::kBestEffort
                                   ? IDLE_PRIORITY_CLASS
                                   : NORMAL_PRIORITY_CLASS;

  if (base::win::OSInfo::GetInstance()->version() >=
          base::win::Version::WIN11 &&
      FeatureList::IsEnabled(kUseEcoQoSForBackgroundProcess)) {
    PROCESS_POWER_THROTTLING_STATE power_throttling;
    RtlZeroMemory(&power_throttling, sizeof(power_throttling));
    power_throttling.Version = PROCESS_POWER_THROTTLING_CURRENT_VERSION;

    if (priority == Priority::kBestEffort) {
      // Sets Eco QoS level.
      power_throttling.ControlMask = PROCESS_POWER_THROTTLING_EXECUTION_SPEED;
      power_throttling.StateMask = PROCESS_POWER_THROTTLING_EXECUTION_SPEED;
    } else {
      // Uses system default.
      power_throttling.ControlMask = 0;
      power_throttling.StateMask = 0;
    }
    bool ret =
        ::SetProcessInformation(Handle(), ProcessPowerThrottling,
                                &power_throttling, sizeof(power_throttling));
    if (ret == 0) {
      DPLOG(ERROR) << "Setting process QoS policy fails";
    }
  }

  return (::SetPriorityClass(Handle(), priority_class) != 0);
}

ollama.exe set ollama_llama_server.exe

from ollama.

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.