Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High cpu usage for Xorg when using picom #2901

Closed
kaiphat opened this issue Dec 29, 2022 · 8 comments
Closed

High cpu usage for Xorg when using picom #2901

kaiphat opened this issue Dec 29, 2022 · 8 comments
Labels
bug Something isn't working waiting-on-op Waiting for more information from the original poster

Comments

@kaiphat
Copy link

kaiphat commented Dec 29, 2022

What Operating System(s) are you seeing this problem on?

Linux X11

Which Wayland compositor or X11 Window manager(s) are you using?

i3-gaps. I tried with lightdm and gdm - the same.

WezTerm version

20221225-233013-ff2caf4f

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

When i open wezterm, Xorg uses a lot of cpu resource. It doesn't always happen right away, sometimes after a while. And value of cpu usage gradually increases before 100%. I see freezes in wezterm in the same time.
image
image

It doesn't happen with alacritty and kitty.
It doesn't happen in gnome ubuntu, only when i use i3wm.

To Reproduce

No response

Configuration

local wezterm = require 'wezterm'

-- FONTS --

local font = function(name, params)
  local names = {
    name,
    'Iosevka Nerd Font',
  }

  return wezterm.font_with_fallback(names, params)
end

local font_config = ({
  jet_brains = {
    font_size = 9.5,
    font = wezterm.font('JetBrainsMono Nerd Font'),
    cell_width = 0.87,
    font_rules = {
      {
        font = wezterm.font('JetBrainsMono Nerd Font', { weight = 'Medium' }),
      },
    },
    line_height = 0.9,
  },
  iosevka = {
    font_size = 10.7,
    font = wezterm.font('Iosevka Nerd Font'),
    line_height = 0.9,
    font_rules = {
      {
        font = font('Iosevka Nerd Font', { italic = false, weight = 'Medium' })
      }
    }
  },
  victor_mono = {
    font_size = 10,
    font = font('VictorMono'),
    line_height = 0.80,
    font_rules = {
      {
        font = font('VictorMono', { italic = false })
      }
    }
  },
  caskaydia = {
    font_size = 10.2,
    line_height = 1,
    cell_width = 1,
    font = wezterm.font('CaskaydiaCovePL Nerd Font'),
    font_rules = {
      {
        italic = true,
        font = wezterm.font('CaskaydiaCovePL Nerd Font', { italic = false, weight = 'Regular' })
      },
      {
        intensity = 'Bold',
        font = wezterm.font('CaskaydiaCovePL Nerd Font', { italic = false, weight = 'Regular' })
      },
      {
        font = wezterm.font('CaskaydiaCovePL Nerd Font', { italic = false, weight = 'Regular' })
      }
    }
  },
  mononoki = {
    font_size = 10.3,
    font = font 'mononoki Nerd Font',
    cell_width = 0.87,
    line_height = 1,
    font_rules = {
      {
        font = font('mononoki Nerd Font', { italic = false, weight = 'Bold' })
      }
    }
  },
  fira = {
    font_size = 9.4,
    font = wezterm.font 'FiraCode Nerd Font',
    line_height = 1,
    cell_width = 0.83,
    font_rules = {
      {
        font = wezterm.font('FiraCode Nerd Font', { italic = false, weight = 'Medium' })
      }
    }
  },
  hack = {
    font_size = 10.2,
    font = font 'Hack Nerd Font',
    line_height = 1,
    font_rules = {
      {
        font = wezterm.font('Hack Nerd Font', { italic = false, weight = 'Regular' })
      }
    }
  },
}).jet_brains

-- UTILS --

local merge = function(list)
  local result = list[1]

  for i = 2, #list do
    for key, value in pairs(list[i]) do
      result[key] = value
    end
  end

  return result
end

-- EVENTS --

wezterm.on('gui-startup', function(cmd)
  local _, _, window = wezterm.mux.spawn_window(cmd or {})
  window:gui_window():maximize()
end)

-- THEME --

local colors = {
  foreground = "#787C99",
  background = "#202837",
  cursor_bg = "#ffcc66",
  cursor_border = "#ffcc66",
  cursor_fg = "#404060",
  selection_fg = "#333355",
  selection_bg = "#787c99",
  scrollbar_thumb = "#222222",
  compose_cursor = "orange",
  ansi = {
    '#404060',
    '#F7768E',
    '#9CC4B2',
    '#88C0D0',
    '#6e88a6',
    '#9398cf',
    '#c8ae9d',
    '#E5E9F0',
  },
  brights = {
    '#9CC4B2',
    '#F7768E',
    '#9CC4B2',
    '#ffcc66',
    '#6e88a6',
    '#9398cf',
    '#c8ae9d',
    '#ACB0D0',
  },
}

local padding = {
  left = 0,
  right = 0,
  top = 0,
  bottom = 0,
}

-- RESULT --

local config = {
  colors = colors,
  window_padding = padding,
  enable_tab_bar = false,
  scrollback_lines = 10000,
  cursor_blink_rate = 700,
  max_fps = 60,
  animation_fps = 30,
  window_background_opacity = 0.93,
  enable_kitty_graphics = true,
  default_cursor_style = 'BlinkingBlock',
  freetype_load_target = 'HorizontalLcd',
}

return merge {
  config,
  font_config,
}

Expected Behavior

No response

Logs

No response

Anything else?

No response

@kaiphat kaiphat added the bug Something isn't working label Dec 29, 2022
@wez
Copy link
Owner

wez commented Dec 29, 2022

Please fill out the logs section:

Activate the Debug Overlay by pressing CTRL-SHIFT-L and then copy
and paste the log lines in here. If you launched wezterm from
the command line, copy and paste that output here.
You can also find log files in $XDG_RUNTIME_DIR/wezterm on unix systems,
or $HOME/.local/share/wezterm on macOS and Windows systems.

You may wish to try altering the values of the following configuration to adjust the load on your system:

  • animation_fps (or disable the use of blinking cursors)
  • window_background_opacity (try making it fully opaque)

You may also wish to try enabling WebGPU to see if that affects the load, see:

@wez wez added the waiting-on-op Waiting for more information from the original poster label Dec 29, 2022
@kaiphat
Copy link
Author

kaiphat commented Dec 29, 2022

I tried it previous, but it doesn't help. Also the same with front_end = "WebGpu".
image

@github-actions github-actions bot removed the waiting-on-op Waiting for more information from the original poster label Dec 29, 2022
@kaiphat
Copy link
Author

kaiphat commented Dec 29, 2022

After ctrl+shift+l

Debug Overlay
wezterm version: 20221225-233013-ff2caf4f
OpenGL version: Mesa Intel(R) HD Graphics 530 (SKL GT2) 4.6 (Compatibility Profile) Mesa 22.2.1
Enter lua statements or expressions and hit Enter.

@kaiphat
Copy link
Author

kaiphat commented Dec 29, 2022

In logs i didn't find something interesting.

@kaiphat
Copy link
Author

kaiphat commented Jan 9, 2023

I noticed that it connects with picom. When i disabled picom, xorg doesn't use a lot of cpu. But still it happens only with wezterm.

@wez
Copy link
Owner

wez commented Jan 9, 2023

This sounds like it is an issue at the intersection of picom and the intel graphics drivers on your system.
wezterm can't control those. If disabling picom resolves the CPU utilization issue, it sounds like this may be more of a picom issue than a wezterm issue.

I'd suggest looking at the picom issue tracker to see if others have similar problems, or to help you uncover issues with the picom configuration; here's the first one I found:

but there may be other things that are more applicable to your system

@wez wez added the waiting-on-op Waiting for more information from the original poster label Jan 9, 2023
@wez wez changed the title High cpu usage for Xorg High cpu usage for Xorg when using picom Jan 9, 2023
@github-actions
Copy link
Contributor

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@github-actions
Copy link
Contributor

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working waiting-on-op Waiting for more information from the original poster
Projects
None yet
Development

No branches or pull requests

2 participants