NVIDIA GPU not fully utilized and heavy CPU use while NVENC re-encoding

linux-zen 5.18.3
nvidia 515.48.07
cuda 11.7

I used handbrake-nvenc (built from aur)
it only utilizes 11%(max) of GPU and 94% CPU
when I try using shutter-encoder (built from aur ) it fails to enocde video with error-log



System:
  Kernel: 5.18.3-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 12.1.0
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
    root=UUID=805adb07-9a50-4814-ae9c-07a7e0484a19 rw [email protected]
    quiet loglevel=3 mitigations=off systemd.unified_cgroup_hierarchy=1
    splash
  Desktop: KDE Plasma v: 5.24.5 tk: Qt v: 5.15.4 wm: kwin_x11 vt: 1
    dm: SDDM Distro: Garuda Linux base: Arch Linux
Machine:
  Type: Laptop System: Acer product: Nitro AN515-54 v: V1.33
    serial: <superuser required>
  Mobo: CFL model: Octavia_CFS v: V1.33 serial: <superuser required>
    UEFI: Insyde v: 1.33 date: 11/17/2020
Battery:
  ID-1: BAT1 charge: 45.2 Wh (100.0%) condition: 45.2/57.5 Wh (78.6%)
    volts: 16.8 min: 15.4 model: LGC AP18E8M type: Li-ion serial: <filter>
    status: full
CPU:
  Info: model: Intel Core i5-9300H bits: 64 type: MT MCP arch: Coffee Lake
    gen: core 9 built: 2018 process: Intel 14nm family: 6 model-id: 0x9E (158)
    stepping: 0xA (10) microcode: 0xF0
  Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache:
    L1: 256 KiB desc: d-4x32 KiB; i-4x32 KiB L2: 1024 KiB desc: 4x256 KiB
    L3: 8 MiB desc: 1x8 MiB
 
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel CoffeeLake-H GT2 [UHD Graphics 630]
    vendor: Acer Incorporated ALI driver: i915 v: kernel arch: Gen9.5
    process: Intel 14nm built: 2016-20 ports: active: eDP-1 empty: none
    bus-ID: 00:02.0 chip-ID: 8086:3e9b class-ID: 0300
  Device-2: NVIDIA TU117M [GeForce GTX 1650 Mobile / Max-Q]
    vendor: Acer Incorporated ALI driver: nvidia v: 515.48.07
    alternate: nouveau,nvidia_drm non-free: 515.xx+
    status: current (as of 2022-06) arch: Turing process: TSMC 12nm
    built: 2018-22 pcie: gen: 1 speed: 2.5 GT/s lanes: 16 link-max: gen: 3
  OpenGL: renderer: Mesa Intel UHD Graphics 630 (CFL GT2)
    v: 4.6 Mesa 22.1.1 direct render: Yes
Audio:
  Device-1: Intel Cannon Lake PCH cAVS vendor: Acer Incorporated ALI
    driver: snd_hda_intel v: kernel
    alternate: snd_soc_skl,snd_sof_pci_intel_cnl bus-ID: 00:1f.3
    chip-ID: 8086:a348 class-ID: 0403
  Device-2: NVIDIA vendor: Acer Incorporated ALI driver: snd_hda_intel
    v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 16 link-max: gen: 3
    speed: 8 GT/s bus-ID: 01:00.1 chip-ID: 10de:10fa class-ID: 0403
  Sound Server-1: ALSA v: k5.18.3-zen1-1-zen running: yes
  Sound Server-2: JACK v: 1.9.21 running: no
  Sound Server-3: PulseAudio v: 16.0 running: yes
  Sound Server-4: PipeWire v: 0.3.52 running: yes
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Acer Incorporated ALI driver: r8169 v: kernel pcie: gen: 1
    speed: 2.5 GT/s lanes: 1 port: 3000 bus-ID: 07:00.0 chip-ID: 10ec:8168
    class-ID: 0200
  IF: enp7s0 state: down mac: <filter>
  Device-2: Intel Wi-Fi 6 AX200 driver: iwlwifi v: kernel pcie: gen: 2
    speed: 5 GT/s lanes: 1 bus-ID: 08:00.0 chip-ID: 8086:2723 class-ID: 0280
  IF: wlp8s0 state: up mac: <filter>
Bluetooth:
  Device-1: Intel AX200 Bluetooth type: USB driver: btusb v: 0.8
    bus-ID: 1-14:3 chip-ID: 8087:0029 class-ID: e001
  Report: bt-adapter ID: hci0 rfk-id: 4 state: up address: <filter>
Drives:
  Local Storage: total: 1.14 TiB used: 544.02 GiB (46.5%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Micron
    model: 2200 MTFDHBA256TCK size: 238.47 GiB block-size: physical: 512 B
    logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: P1MA003 temp: 54.9 C scheme: GPT
  ID-2: /dev/sda maj-min: 8:0 vendor: Seagate model: ST1000LM049-2GH172
    size: 931.51 GiB block-size: physical: 4096 B logical: 512 B
    speed: 6.0 Gb/s type: HDD rpm: 7200 serial: <filter> rev: ACM1
    scheme: GPT
Partition:
  ID-1: / raw-size: 238.17 GiB size: 238.17 GiB (100.00%)
    used: 122.81 GiB (51.6%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 576 KiB (0.2%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
  ID-3: /home raw-size: 238.17 GiB size: 238.17 GiB (100.00%)
    used: 122.81 GiB (51.6%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-4: /var/log raw-size: 238.17 GiB size: 238.17 GiB (100.00%)
    used: 122.81 GiB (51.6%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-5: /var/tmp raw-size: 238.17 GiB size: 238.17 GiB (100.00%)
    used: 122.81 GiB (51.6%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
Swap:
  Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: zram size: 15.46 GiB used: 5.4 MiB (0.0%)
    priority: 100 dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 84.0 C pch: 86.0 C mobo: N/A
  Fan Speeds (RPM): N/A
Info:
  Processes: 296 Uptime: 11h 34m wakeups: 12 Memory: 15.46 GiB
  used: 7.88 GiB (50.9%) Init: systemd v: 251 default: graphical
  tool: systemctl Compilers: gcc: 12.1.0 Packages: pacman: 1181 lib: 305
  Shell: fish v: 3.4.1 running-in: konsole inxi: 3.3.17
e[1;34mGaruda (2.6.3-2):e[0m
e[1;34m  System install date:e[0m     2022-06-09
e[1;34m  Last full system update:e[0m 2022-06-12 e[1;31m↻
e[1;34m  Is partially upgraded:  e[0m No
e[1;34m  Relevant software:      e[0m NetworkManager
e[1;34m  Windows dual boot:      e[0m No/Undetected
e[1;34m  Snapshots:              e[0m Snapper
e[1;34m  Failed units:           e[0m 

Something is wrong I can feel it NVENC used to give constant 150+ fps on 1080p24fps decode

optimus manager had set gpu to hybrid mode

have you tried prime run

1 Like

how to run gui apps with prime-run ?

$prime-run handbrake
error 127 command not found

same for $prime-run handbrake-nvenc

It would have been nice to know what you have already tried?
What else have you tried ?

2 Likes

I have tried shutter , but it fails to even start
I have tried mkvtoolnix-gui but I could not find option for h264.nvenc
going to reboot in nvida only mode to check if optimus is causing problems

edit same on NVIDIA only mode , high CPU use very low GPU use

1 Like

If i remember handbrake is cpu not gpu optimized

1 Like

It looks like you have to go into the settings and change it from CPU to GPU.

3 Likes

When?

Decoding is not the same as encoding. NVENC won't help with decoding.

3 Likes

It that request even helpful then? :eyes:

2 Likes

I thought if they will build , they will sort out the bugs maybe my AUR build is to blame

On Ubuntu 20.04 in 2020 with Nvidia 4XX series drivers

That's 2 years ago, what if you try Ubuntu now?

I cant leave my comfort of arch for ubuntu now (not until new DE pop os is launched )

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.