Nvidia-drivers-not-working on gtx-1050

I have a laptop with hybrid Intel+Nvidia graphics.

When I am running opencl code or cuda code, the display card cannot be loaded

nvidia-smi

NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

init -G

Graphics:
  Device-1: Intel CoffeeLake-H GT2 [UHD Graphics 630] driver: i915 v: kernel
  Device-2: NVIDIA GP107M [GeForce GTX 1050 3 GB Max-Q] driver: N/A
  Device-3: Lite-On Integrated Camera type: USB driver: uvcvideo
  Display: x11 server: X.Org v: 21.1.4 with: Xwayland v: 22.1.5 driver: X:
    loaded: modesetting dri: iris gpu: i915 resolution: 1920x1080~60Hz
  API: OpenGL v: 4.6 Mesa 22.2.3 renderer: Mesa Intel UHD Graphics 630 (CFL
    GT2)

inxi --full --verbosity=7 --filter --no-host

System:
  Kernel: 5.15.78-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    Desktop: GNOME v: 43.1 tk: GTK v: 3.24.34 wm: gnome-shell dm: LightDM
    v: 1.32.0 Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Laptop System: LENOVO product: 81V4 v: Lenovo Legion Y7000 2019 1050
    serial: <superuser required> Chassis: type: 10 v: Lenovo Legion Y7000 2019
    1050 serial: <superuser required>
  Mobo: LENOVO model: LNVNB161216 v: SDK0L77769 WIN
    serial: <superuser required> UEFI: LENOVO v: BTCN13WW date: 09/11/2019
Battery:
  ID-1: BAT0 charge: 44.5 Wh (95.9%) condition: 46.4/52.5 Wh (88.4%)
    volts: 12.6 min: 11.2 model: SMP L17M3PG1 type: Li-poly serial: <filter>
    status: N/A cycles: 501
Memory:
  RAM: total: 15.5 GiB used: 4.22 GiB (27.3%)
  RAM Report: permissions: Unable to run dmidecode. Root privileges
    required.
CPU:
  Info: quad core model: Intel Core i5-9300H bits: 64 type: MT MCP
    smt: enabled arch: Coffee Lake rev: A cache: L1: 256 KiB L2: 1024 KiB
    L3: 8 MiB
  Speed (MHz): avg: 4048 high: 4100 min/max: 800/4100 cores: 1: 4051 2: 4100
    3: 4100 4: 4056 5: 4025 6: 4057 7: 4000 8: 4000 bogomips: 38408
  Flags: 3dnowprefetch abm acpi adx aes aperfmperf apic arat
    arch_capabilities arch_perfmon art avx avx2 bmi1 bmi2 bts clflush
    clflushopt cmov constant_tsc cpuid cpuid_fault cx16 cx8 de ds_cpl dtes64
    dtherm dts epb ept ept_ad erms est f16c flexpriority flush_l1d fma fpu
    fsgsbase fxsr ht hwp hwp_act_window hwp_epp hwp_notify ibpb ibrs ida
    intel_pt invpcid invpcid_single lahf_lm lm mca mce md_clear mmx monitor
    movbe mpx msr mtrr nonstop_tsc nopl nx pae pat pbe pcid pclmulqdq pdcm
    pdpe1gb pebs pge pln pni popcnt pse pse36 pti pts rdrand rdseed rdtscp
    rep_good sdbg sep smap smep ss ssbd sse sse2 sse4_1 sse4_2 ssse3 stibp
    syscall tm tm2 tpr_shadow tsc tsc_adjust tsc_deadline_timer vme vmx vnmi
    vpid x2apic xgetbv1 xsave xsavec xsaveopt xsaves xtopology xtpr
Graphics:
  Device-1: Intel CoffeeLake-H GT2 [UHD Graphics 630] vendor: Lenovo
    driver: i915 v: kernel arch: Gen-9.5 ports: active: eDP-1 empty: DP-1,
    DP-2, DP-3, HDMI-A-1, HDMI-A-2 bus-ID: 00:02.0 chip-ID: 8086:3e9b
    class-ID: 0300
  Device-2: NVIDIA GP107M [GeForce GTX 1050 3 GB Max-Q] vendor: Lenovo
    driver: N/A arch: Pascal pcie: speed: Unknown lanes: 63 bus-ID: 01:00.0
    chip-ID: 10de:1c91 class-ID: 0300
  Device-3: Lite-On Integrated Camera type: USB driver: uvcvideo
    bus-ID: 1-6:2 chip-ID: 04ca:7070 class-ID: 0e02
  Display: x11 server: X.Org v: 21.1.4 with: Xwayland v: 22.1.5
    compositor: gnome-shell driver: X: loaded: modesetting alternate: intel
    dri: iris gpu: i915 display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22")
    s-diag: 582mm (22.93")
  Monitor-1: eDP-1 model: LG Display 0x05e5 res: 1920x1080 hz: 60 dpi: 142
    size: 344x194mm (13.54x7.64") diag: 395mm (15.5") modes: 1920x1080
  API: OpenGL v: 4.6 Mesa 22.2.3 renderer: Mesa Intel UHD Graphics 630 (CFL
    GT2) direct render: Yes
Audio:
  Device-1: Intel Cannon Lake PCH cAVS vendor: Lenovo driver: snd_hda_intel
    v: kernel bus-ID: 00:1f.3 chip-ID: 8086:a348 class-ID: 0403
  Device-2: NVIDIA GP107GL High Definition Audio driver: snd_hda_intel
    v: kernel pcie: speed: Unknown lanes: 63 bus-ID: 01:00.1 chip-ID: 10de:0fb9
    class-ID: 0403
  Sound API: ALSA v: k5.15.78-1-MANJARO running: yes
  Sound Server-1: JACK v: 1.9.21 running: no
  Sound Server-2: PulseAudio v: 16.1 running: yes
  Sound Server-3: PipeWire v: 0.3.59 running: yes
Network:
  Device-1: Intel Cannon Lake PCH CNVi WiFi driver: iwlwifi v: kernel
    bus-ID: 00:14.3 chip-ID: 8086:a370 class-ID: 0280
  IF: wlp0s20f3 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
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Lenovo driver: r8169 v: kernel pcie: 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>
  IF-ID-1: vmnet1 state: unknown speed: N/A duplex: N/A mac: <filter>
  IP v4: <filter> scope: global broadcast: <filter>
  IP v6: <filter> scope: link
  IF-ID-2: vmnet8 state: unknown speed: N/A duplex: N/A mac: <filter>
  Message: Output throttled. IPs: 2; Limit: 10; Override: --limit [1-x;-1
    all]
  WAN IP: <filter>
Bluetooth:
  Device-1: Intel Bluetooth 9460/9560 Jefferson Peak (JfP) type: USB
    driver: btusb v: 0.8 bus-ID: 1-14:3 chip-ID: 8087:0aaa class-ID: e001
  Report: rfkill ID: hci0 rfk-id: 3 state: up address: see --recommends
Logical:
  Message: No logical block device data found.
RAID:
  Message: No RAID data found.
Drives:
  Local Storage: total: 1.14 TiB used: 182.15 GiB (15.6%)
  ID-1: /dev/nvme0n1 vendor: Samsung model: MZVLB256HBHQ-000L2
    size: 238.47 GiB speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: 3L1QEXH7 temp: 36.9 C scheme: GPT
  ID-2: /dev/sda vendor: Western Digital model: WD10SPZX-24Z10
    size: 931.51 GiB speed: 6.0 Gb/s type: HDD rpm: 5400 serial: <filter>
    rev: 1A04
  Message: No optical or floppy data found.
Partition:
  ID-1: / size: 233.38 GiB used: 182.15 GiB (78.0%) fs: ext4
    dev: /dev/nvme0n1p2 label: N/A uuid: 88a78f5a-395d-475e-af8f-1faa59d6a0d3
  ID-2: /boot/efi size: 299.4 MiB used: 288 KiB (0.1%) fs: vfat
    dev: /dev/nvme0n1p1 label: NO_LABEL uuid: 1EE2-5EC9
Swap:
  Alert: No swap data was found.
Unmounted:
  Message: No unmounted partitions found.
USB:
  Hub-1: 1-0:1 info: Hi-speed hub with single TT ports: 16 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Device-1: 1-6:2 info: Lite-On Integrated Camera type: Video
    driver: uvcvideo interfaces: 2 rev: 2.0 speed: 480 Mb/s power: 500mA
    chip-ID: 04ca:7070 class-ID: 0e02
  Device-2: 1-14:3 info: Intel Bluetooth 9460/9560 Jefferson Peak (JfP)
    type: Bluetooth driver: btusb interfaces: 2 rev: 2.0 speed: 12 Mb/s
    power: 100mA chip-ID: 8087:0aaa class-ID: e001
  Hub-2: 2-0:1 info: Super-speed hub ports: 8 rev: 3.1 speed: 10 Gb/s
    chip-ID: 1d6b:0003 class-ID: 0900
Sensors:
  System Temperatures: cpu: 37.0 C pch: 44.0 C mobo: N/A
  Fan Speeds (RPM): N/A
Info:
  Processes: 310 Uptime: 14m wakeups: 1 Init: systemd v: 251
  default: graphical Compilers: gcc: 12.2.0 alt: 11 clang: 14.0.6 Packages:
  pm: pacman pkgs: 1870 Shell: Zsh v: 5.9 running-in: gnome-terminal
  inxi: 3.3.23

pamac list --installed | grep nvidia

lib32-nvidia-utils                        520.56.06-1                   multilib   167.3 MB
lib32-opencl-nvidia                       520.56.06-1                   multilib   77.8 MB
linux515-nvidia                           520.56.06-9                   extra      53.0 MB
mhwd-nvidia                               520.56.06-2                   extra      1.5 kB
mhwd-nvidia-390xx                         390.154-2                     extra      1.9 kB
mhwd-nvidia-470xx                         470.141.03-3                  extra      1.8 kB
nvidia-prime                              1.0-4                         extra      112 字节
nvidia-utils                              520.56.06-2                   extra      658.3 MB
opencl-nvidia                             520.56.06-2                   extra      76.7 MB

mhwd -li

mInstalled PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
     video-modesetting            2020.01.13                true            PCI
video-hybrid-intel-nvidia-prime            2021.11.04               false            PCI


Warning: No installed USB configs!

mhwd -l

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


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


> 0000:00:02.0 (0300:8086:3e9b) Display controller Intel Corporation:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-intel-nvidia-prime            2021.11.04               false            PCI
video-hybrid-intel-nvidia-470xx-prime            2021.11.04               false            PCI
           video-linux            2018.05.04                true            PCI
     video-modesetting            2020.01.13                true            PCI
            video-vesa            2017.03.12                true            PCI

help me :sob: :sob: :sob:

I see you have PRIME installed, but are you actually using it?

Somehow your nvidia driver is not properly detected. You could try to reinstall by

sudo mhwd --install pci video-hybrid-intel-nvidia-prime

Also, please post output of

ls -la /etc/X11

Welcome to the forum! :wave:

Please see How to Post and edit your topic title accordingly.

That is the correct MHWD profile for your system, however…

Please post the output of that command as well.