PRIME GPU offloading not working

Hello,
My laptop met the same situation as Nvidia X Server Settings and prime-run not working! .Minecraft , glxinfo and all applications run with prime-run not working.

$ prime-run glxspheres64 
Polygons in scene: 62464 (61 spheres * 1024 polys/spheres)
GLX FB config ID of window: 0xbe (8/8/8/0)
Visual ID of window: 0x127
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  152 (GLX)
  Minor opcode of failed request:  3 (X_GLXCreateContext)
  Value in failed request:  0x0
  Serial number of failed request:  28
  Current serial number in output stream:  29


$ mhwd --listinstalled
> Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-intel-nvidia-prime            2021.07.28               false            PCI
     video-modesetting            2020.01.13                true            PCI
           video-linux            2018.05.04                true            PCI
   network-broadcom-wl            2018.10.07                true            PCI


Warning: No installed USB configs!

Minecraft run normally before , after add prime-run command , Minecraft went wrong with these info:

[00:06:47] [Render thread/INFO]: Setting user: ThinkingNull
[00:06:47] [Render thread/INFO]: Backend library: LWJGL version 3.2.2 build 10
[00:06:51] [Render thread/WARN]: Failed to create window: 
dpr$a: GLFW error 65543: GLX: Failed to create context: GLXBadFBConfig
        at dpr.b(SourceFile:218) ~[1.17.1.jar:?]
        at dpr$$Lambda$3009/0x00000000dd58c510.invoke(Unknown Source) ~[?:?]
        at org.lwjgl.glfw.GLFWErrorCallbackI.callback(GLFWErrorCallbackI.java:36) ~[lwjgl-glfw-3.2.2.jar:build 10]
        at org.lwjgl.system.JNI.invokePPPP(Native Method) ~[lwjgl-3.2.2.jar:build 10]
        at org.lwjgl.glfw.GLFW.nglfwCreateWindow(GLFW.java:1714) ~[lwjgl-glfw-3.2.2.jar:build 10]
        at org.lwjgl.glfw.GLFW.glfwCreateWindow(GLFW.java:1897) ~[lwjgl-glfw-3.2.2.jar:build 10]
        at dpr.<init>(SourceFile:92) ~[1.17.1.jar:?]
        at enx.a(SourceFile:21) ~[1.17.1.jar:?]
        at dvp.<init>(SourceFile:481) ~[1.17.1.jar:?]
        at net.minecraft.client.main.Main.main(SourceFile:179) [1.17.1.jar:?]

I have installed the drivers below:

CPU:
  Info: Dual Core model: Intel Core i3-3110M bits: 64 type: MT MCP 
  arch: Ivy Bridge family: 6 model-id: 3A (58) stepping: 9 microcode: 21 
  cache: L2: 3 MiB bogomips: 19167 
  Speed: 1268 MHz min/max: 1200/2400 MHz Core speeds (MHz): 1: 1268 2: 1206 
  3: 1285 4: 1339 
  Flags: acpi aperfmperf apic arat arch_perfmon avx bts clflush cmov 
  constant_tsc cpuid cpuid_fault cx16 cx8 de ds_cpl dtes64 dtherm dts epb ept 
  erms est f16c flexpriority flush_l1d fpu fsgsbase fxsr ht ibpb ibrs lahf_lm 
  lm mca mce md_clear mmx monitor msr mtrr nonstop_tsc nopl nx pae pat pbe 
  pcid pclmulqdq pdcm pebs pge pln pni popcnt pse pse36 pti pts rdtscp 
  rep_good sep smep ss ssbd sse sse2 sse4_1 sse4_2 ssse3 stibp syscall tm tm2 
  tpr_shadow tsc tsc_deadline_timer vme vmx vnmi vpid x2apic xsave xsaveopt 
  xtopology xtpr 
  Vulnerabilities: Type: itlb_multihit status: KVM: VMX disabled 
  Type: l1tf 
  mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable 
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable 
  Type: meltdown mitigation: PTI 
  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: Full generic retpoline, IBPB: conditional, 
  IBRS_FW, STIBP: conditional, RSB filling 
  Type: srbds status: Not affected 
  Type: tsx_async_abort status: Not affected 
Graphics:
  Device-1: Intel 3rd Gen Core processor Graphics vendor: Lenovo driver: i915 
  v: kernel bus-ID: 00:02.0 chip-ID: 8086:0166 class-ID: 0300 
  Device-2: NVIDIA GF117M [GeForce 610M/710M/810M/820M / GT 
  620M/625M/630M/720M] 
  vendor: Lenovo driver: N/A alternate: nouveau, nvidia_drm, nvidia 
  bus-ID: 01:00.0 chip-ID: 10de:1140 class-ID: 0302 
  Device-3: Chicony Integrated Camera type: USB driver: uvcvideo 
  bus-ID: 1-1.6:5 chip-ID: 04f2:b398 class-ID: 0e02 
  Display: x11 server: X.Org 1.20.13 compositor: kwin_x11 driver: 
  loaded: modesetting alternate: fbdev,intel,vesa display-ID: :0 screens: 1 
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 506x285mm (19.9x11.2") 
  s-diag: 581mm (22.9") 
  Monitor-1: HDMI-1 res: 1920x1080 dpi: 82 size: 597x336mm (23.5x13.2") 
  diag: 685mm (27") 
  OpenGL: renderer: Mesa DRI Intel HD Graphics 4000 (IVB GT2) 
  v: 4.2 Mesa 21.1.6 compat-v: 3.0 direct render: Yes 

You do not need video-linux AFAIK, remove it from MHWD, just video-modesetting and video-hybrid-intel-nvidia-prime
Once you remove video-linux also reinstall video-hybrid-intel-nvidia-prime

Sorry for the late reply.
Althrough I reinstalled twice and reboot several times, it still not work and show the same error.

The driver is correctly installed,Minecraft uses OpenGL by any chance? There is a bug in the 470 drivers where OpenGL application can or can’t crash at startup,its random.

Whats the output of

nvidia-smi

Just to be sure,install vulkan-tools package and run vkcube,if with nvidia-smi appears vkcube as a process then yeah the driver is installed correctly.

pamac install vulkan-tools
vkcube
$ 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.

nvidia-smi never worked, no matter driver download on official site or installed by mhwd . When I using Ubuntu on this laptop, nvidia-smi show the same error, but Minecraft use nvidia graphics card correctly on that time. Now graphics card cannot be used by all software, It seems that my graphics card does not exist at all.
Minecraft can run with Intel HD4000. If add prime-run , it could never started.

$ vkcube
vkEnumerateInstanceExtensionProperties failed to find the VK_KHR_surface extension.

That an interesting error,by any chance do you have secure boot enabled on the BIOS? Looking in internet some people says turning off the secureboot fixes the nvidia-smi problem.