Nvidia prime-run working but with really bad performance

i reinstalled gnome because i wanted to encrypt my hard drive. Then I tryed to reinstall the nvidia drivers just as before but now i have way wose performance and the gpu heates up really quickly.

inxi -G

Graphics:
  Device-1: NVIDIA TU117M driver: nvidia v: 510.54
  Device-2: AMD Renoir driver: amdgpu v: kernel
  Device-3: Acer Integrated Camera type: USB driver: uvcvideo
  Display: x11 server: X.org v: 1.21.1.3 with: Xwayland v: 22.1.0 driver:
    X: loaded: modesetting gpu: amdgpu resolution: 1920x1080~60Hz
  OpenGL: renderer: AMD RENOIR (DRM 3.42.0 5.15.28-1-MANJARO LLVM 13.0.1)
    v: 4.6 Mesa 21.3.7

mhwd

> 0000:03:00.0 (0200:10ec:8168) Network controller Realtek Semiconductor Co., Ltd.:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
         network-r8168            2016.04.20                true            PCI


> 0000:01:00.0 (0300:10de:1f99) Display controller nVidia Corporation:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-amd-nvidia-prime            2021.12.18               false            PCI
video-hybrid-amd-nvidia-470xx-prime            2021.12.18               false            PCI
          video-nvidia            2021.12.18               false            PCI
    video-nvidia-470xx            2021.12.18               false            PCI
           video-linux            2018.05.04                true            PCI
     video-modesetting            2020.01.13                true            PCI
            video-vesa            2017.03.12                true            PCI


> 0000:05:00.0 (0300:1002:1636) Display controller ATI Technologies Inc:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-amd-nvidia-prime            2021.12.18               false            PCI
video-hybrid-amd-nvidia-470xx-prime            2021.12.18               false            PCI
           video-linux            2018.05.04                true            PCI
     video-modesetting            2020.01.13                true            PCI
            video-vesa            2017.03.12                true            PCI

provide formated output of:
inxi --admin --verbosity=7 --filter --width
mhwd -li

System:
  Kernel: 5.15.28-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 11.2.0
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-5.15-x86_64
    root=UUID=4676b060-1fc7-4014-bfe0-997dbbed4724 rw rootflags=subvol=@ quiet
    cryptdevice=UUID=da7d9b44-e7a0-49b2-ab5d-c6acaec23998:luks-da7d9b44-e7a0-49b2-ab5d-c6acaec23998
    root=/dev/mapper/luks-da7d9b44-e7a0-49b2-ab5d-c6acaec23998 splash
    apparmor=1 security=apparmor
    resume=/dev/mapper/luks-80e78096-1703-4626-b3d0-7ba21900e670
    udev.log_priority=3
  Desktop: GNOME v: 41.4 tk: GTK v: 3.24.33 wm: gnome-shell dm: GDM v: 41.3
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Laptop System: LENOVO product: 82EY v: IdeaPad Gaming 3 15ARH05
    serial: <superuser required> Chassis: type: 10 v: IdeaPad Gaming 3 15ARH05
    serial: <superuser required>
  Mobo: LENOVO model: LNVNB161216 v: SDK0J40709 WIN
    serial: <superuser required> UEFI: LENOVO v: FCCN16WW date: 01/05/2021
Battery:
  ID-1: BAT0 charge: 33.8 Wh (75.3%) condition: 44.9/45.5 Wh (98.7%)
    volts: 11.9 min: 11.4 model: Sunwoda L19D3PF4 type: Li-poly serial: <filter>
    status: discharging cycles: 4
Memory:
  RAM: total: 15.07 GiB used: 4.84 GiB (32.1%)
  RAM Report:
    permissions: Unable to run dmidecode. Root privileges required.
CPU:
  Info: model: AMD Ryzen 5 4600H with Radeon Graphics bits: 64 type: MT MCP
    arch: Zen 2 family: 0x17 (23) model-id: 0x60 (96) stepping: 1
    microcode: 0x8600104
  Topology: cpus: 1x cores: 6 tpc: 2 threads: 12 smt: enabled cache:
    L1: 384 KiB desc: d-6x32 KiB; i-6x32 KiB L2: 3 MiB desc: 6x512 KiB L3: 8 MiB
    desc: 2x4 MiB
  Speed (MHz): avg: 1395 high: 1397 min/max: 1400/3000 boost: enabled
    scaling: driver: acpi-cpufreq governor: schedutil cores: 1: 1397 2: 1396
    3: 1397 4: 1392 5: 1386 6: 1390 7: 1397 8: 1397 9: 1397 10: 1397 11: 1397
    12: 1397 bogomips: 71895
  Flags: 3dnowprefetch abm adx aes aperfmperf apic arat avic avx avx2 bmi1
    bmi2 bpext cat_l3 cdp_l3 clflush clflushopt clwb clzero cmov cmp_legacy
    constant_tsc cpb cpuid cqm cqm_llc cqm_mbm_local cqm_mbm_total
    cqm_occup_llc cr8_legacy cx16 cx8 de decodeassists extapic extd_apicid
    f16c flushbyasid fma fpu fsgsbase fxsr fxsr_opt ht hw_pstate ibpb ibrs ibs
    irperf lahf_lm lbrv lm mba mca mce misalignsse mmx mmxext monitor movbe
    msr mtrr mwaitx nonstop_tsc nopl npt nrip_save nx osvw overflow_recov pae
    pat pausefilter pclmulqdq pdpe1gb perfctr_core perfctr_llc perfctr_nb
    pfthreshold pge pni popcnt pse pse36 rapl rdpid rdpru rdrand rdseed rdt_a
    rdtscp rep_good sep sha_ni skinit smap smca smep ssbd sse sse2 sse4_1
    sse4_2 sse4a ssse3 stibp succor svm svm_lock syscall tce topoext tsc
    tsc_scale umip v_spec_ctrl v_vmsave_vmload vgif vmcb_clean vme vmmcall
    wbnoinvd wdt xgetbv1 xsave xsavec xsaveerptr xsaveopt xsaves
  Vulnerabilities:
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: spec_store_bypass
    mitigation: Speculative Store Bypass disabled via prctl and seccomp
  Type: spectre_v1
    mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, IBRS_FW,
    STIBP: conditional, RSB filling
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: NVIDIA TU117M vendor: Lenovo driver: nvidia v: 510.54
    alternate: nouveau,nvidia_drm pcie: gen: 1 speed: 2.5 GT/s lanes: 8
    link-max: gen: 3 speed: 8 GT/s lanes: 16 bus-ID: 01:00.0
    chip-ID: 10de:1f99 class-ID: 0300
  Device-2: AMD Renoir vendor: Lenovo driver: amdgpu v: kernel pcie: gen: 4
    speed: 16 GT/s lanes: 16 ports: active: eDP-1 empty: none bus-ID: 05:00.0
    chip-ID: 1002:1636 class-ID: 0300
  Device-3: Acer Integrated Camera type: USB driver: uvcvideo bus-ID: 1-3:3
    chip-ID: 5986:212b class-ID: 0e02
  Display: x11 server: X.org v: 1.21.1.3 with: Xwayland v: 22.1.0
    compositor: gnome-shell driver: X: loaded: modesetting gpu: amdgpu
    display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-size: <missing: xdpyinfo>
  Monitor-1: eDP-1 model: ChiMei InnoLux 0x15e7 built: 2020 res: 1920x1080
    hz: 60 dpi: 142 gamma: 1.2 size: 344x193mm (13.54x7.6") diag: 394mm (15.5")
    ratio: 16:9 modes: max: 1920x1080 min: 640x480
  OpenGL: renderer: AMD RENOIR (DRM 3.42.0 5.15.28-1-MANJARO LLVM 13.0.1)
    v: 4.6 Mesa 21.3.7 direct render: Yes
Audio:
  Device-1: NVIDIA vendor: Lenovo driver: snd_hda_intel v: kernel pcie: gen: 1
    speed: 2.5 GT/s lanes: 8 link-max: gen: 3 speed: 8 GT/s lanes: 16
    bus-ID: 01:00.1 chip-ID: 10de:10fa class-ID: 0403
  Device-2: AMD ACP/ACP3X/ACP6x Audio Coprocessor vendor: Lenovo driver: N/A
    alternate: snd_pci_acp3x, snd_rn_pci_acp3x, snd_pci_acp5x pcie: gen: 4
    speed: 16 GT/s lanes: 16 bus-ID: 05:00.5 chip-ID: 1022:15e2 class-ID: 0480
  Device-3: AMD Family 17h/19h HD Audio vendor: Lenovo driver: snd_hda_intel
    v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16 bus-ID: 05:00.6
    chip-ID: 1022:15e3 class-ID: 0403
  Sound Server-1: ALSA v: k5.15.28-1-MANJARO running: yes
  Sound Server-2: JACK v: 1.9.20 running: no
  Sound Server-3: PulseAudio v: 15.0 running: yes
  Sound Server-4: PipeWire v: 0.3.48 running: yes
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Lenovo driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1
    port: 2000 bus-ID: 03:00.0 chip-ID: 10ec:8168 class-ID: 0200
  IF: eno1 state: down mac: <filter>
  Device-2: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter
    vendor: Lenovo driver: ath10k_pci v: kernel pcie: gen: 1 speed: 2.5 GT/s
    lanes: 1 bus-ID: 04:00.0 chip-ID: 168c:003e class-ID: 0280
  IF: wlp4s0 state: up mac: <filter>
  IP v4: <filter> type: dynamic noprefixroute scope: global
    broadcast: <filter>
  IP v6: <filter> type: dynamic noprefixroute scope: global
  IP v6: <filter> type: noprefixroute scope: link
  WAN IP: <filter>
Bluetooth:
  Device-1: Qualcomm Atheros QCA61x4 Bluetooth 4.0 type: USB driver: btusb
    v: 0.8 bus-ID: 3-3:2 chip-ID: 0cf3:e300 class-ID: e001
  Report: rfkill ID: hci0 rfk-id: 2 state: down bt-service: enabled,running
    rfk-block: hardware: no software: yes address: see --recommends
Logical:
  Message: No logical block device data found.
  Device-1: luks-da7d9b44-e7a0-49b2-ab5d-c6acaec23998 maj-min: 254:0
    type: LUKS dm: dm-0 size: 467.84 GiB
  Components:
  p-1: nvme0n1p2 maj-min: 259:2 size: 467.84 GiB
  Device-2: luks-80e78096-1703-4626-b3d0-7ba21900e670 maj-min: 254:1
    type: LUKS dm: dm-1 size: 8.8 GiB
  Components:
  p-1: nvme0n1p3 maj-min: 259:3 size: 8.8 GiB
RAID:
  Message: No RAID data found.
Drives:
  Local Storage: total: 476.94 GiB used: 67.81 GiB (14.2%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: SK Hynix
    model: HFM512GDHTNI-87A0B size: 476.94 GiB block-size: physical: 512 B
    logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: 11020C00 temp: 36.9 C scheme: GPT
  Message: No optical or floppy data found.
Partition:
  ID-1: / raw-size: 467.84 GiB size: 467.84 GiB (100.00%)
    used: 67.81 GiB (14.5%) fs: btrfs dev: /dev/dm-0 maj-min: 254:0
    mapped: luks-da7d9b44-e7a0-49b2-ab5d-c6acaec23998 label: N/A
    uuid: 4676b060-1fc7-4014-bfe0-997dbbed4724
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 712 KiB (0.2%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
    label: NO_LABEL uuid: A969-E30F
  ID-3: /home raw-size: 467.84 GiB size: 467.84 GiB (100.00%)
    used: 67.81 GiB (14.5%) fs: btrfs dev: /dev/dm-0 maj-min: 254:0
    mapped: luks-da7d9b44-e7a0-49b2-ab5d-c6acaec23998 label: N/A
    uuid: 4676b060-1fc7-4014-bfe0-997dbbed4724
  ID-4: /var/cache raw-size: 467.84 GiB size: 467.84 GiB (100.00%)
    used: 67.81 GiB (14.5%) fs: btrfs dev: /dev/dm-0 maj-min: 254:0
    mapped: luks-da7d9b44-e7a0-49b2-ab5d-c6acaec23998 label: N/A
    uuid: 4676b060-1fc7-4014-bfe0-997dbbed4724
  ID-5: /var/log raw-size: 467.84 GiB size: 467.84 GiB (100.00%)
    used: 67.81 GiB (14.5%) fs: btrfs dev: /dev/dm-0 maj-min: 254:0
    mapped: luks-da7d9b44-e7a0-49b2-ab5d-c6acaec23998 label: N/A
    uuid: 4676b060-1fc7-4014-bfe0-997dbbed4724
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default)
  ID-1: swap-1 type: partition size: 8.8 GiB used: 0 KiB (0.0%) priority: -2
    dev: /dev/dm-1 maj-min: 254:1
    mapped: luks-80e78096-1703-4626-b3d0-7ba21900e670 label: swap
    uuid: 0be23754-0f84-47ac-9af1-146d24accc08
Unmounted:
  Message: No unmounted partitions found.
USB:
  Hub-1: 1-0:1 info: Hi-speed hub with single TT ports: 4 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Device-1: 1-2:2 info: Logitech M105 Optical Mouse type: Mouse
    driver: hid-generic,usbhid interfaces: 1 rev: 2.0 speed: 1.5 Mb/s
    power: 100mA chip-ID: 046d:c077 class-ID: 0301
  Device-2: 1-3:3 info: Acer Integrated Camera type: Video driver: uvcvideo
    interfaces: 2 rev: 2.0 speed: 480 Mb/s power: 500mA chip-ID: 5986:212b
    class-ID: 0e02
  Hub-2: 2-0:1 info: Super-speed hub ports: 2 rev: 3.1 speed: 10 Gb/s
    chip-ID: 1d6b:0003 class-ID: 0900
  Hub-3: 3-0:1 info: Hi-speed hub with single TT ports: 4 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Device-1: 3-3:2 info: Qualcomm Atheros QCA61x4 Bluetooth 4.0
    type: Bluetooth driver: btusb interfaces: 2 rev: 2.0 speed: 12 Mb/s
    power: 100mA chip-ID: 0cf3:e300 class-ID: e001
  Hub-4: 4-0:1 info: Super-speed hub ports: 2 rev: 3.1 speed: 10 Gb/s
    chip-ID: 1d6b:0003 class-ID: 0900
Sensors:
  System Temperatures: cpu: N/A mobo: N/A gpu: amdgpu temp: 40.0 C
  Fan Speeds (RPM): N/A
Info:
  Processes: 398 Uptime: 18m wakeups: 1 Init: systemd v: 250 tool: systemctl
  Compilers: gcc: 11.2.0 clang: 13.0.1 Packages: 1347 pacman: 1339 lib: 343
  flatpak: 1 snap: 7 Shell: Zsh v: 5.8.1 running-in: gnome-terminal
  inxi: 3.3.15
> Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
           video-linux            2018.05.04                true            PCI
video-hybrid-amd-nvidia-prime            2021.12.18               false            PCI


Warning: No installed USB configs!

and also the output of:
mhwd -li

> Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
           video-linux            2018.05.04                true            PCI
video-hybrid-amd-nvidia-prime            2021.12.18               false            PCI


Warning: No installed USB configs!

i noticed youre running Kernel: 5.15.28-1, there is a newer one, there was recently a system update, did you run the update?

how do i update?

open the add/remove software and click updates
or via command:
pamac update

i am getting a lot of errors
and now it got stuck

did you run the command? then copy the errors

while it was running i got
error 404
and it ended with
Error: Failed to commit transaction: failed to retrieve some files

could be keyring errors… first check which kernels do you have installed:
mhwd-kernel -li

Currently running: 5.15.28-1-MANJARO (linux515)
The following kernels are installed in your system:
   * linux515```

try fixing the errors now, and copy the erros if you get some:
run these commands:
sudo pacman -Syy
sudo pacman-key --refresh-keys
sudo pacman-key --populate archlinux manjaro
pamac update

the second one gives gpg errors

i told you to copy them… so did you run all of those 4 commands? if yes try these:
sudo rm -f /var/lib/pacman/sync/*
sudo pacman -Syyu

i tryed running the first command but nothing happens

yes thats how it should be… run the second and copy possible errors