From nobody Sun Oct 10 13:45:39 2021 X-Original-To: freebsd-x11@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 70EC617ECC34 for ; Sun, 10 Oct 2021 09:45:59 +0000 (UTC) (envelope-from creatxr@gmail.com) Received: from mail-oo1-xc2a.google.com (mail-oo1-xc2a.google.com [IPv6:2607:f8b0:4864:20::c2a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HRxrQ4Hrwz3tFY for ; Sun, 10 Oct 2021 09:45:58 +0000 (UTC) (envelope-from creatxr@gmail.com) Received: by mail-oo1-xc2a.google.com with SMTP id r1-20020a4a9641000000b002b6b55007bfso2193715ooi.3 for ; Sun, 10 Oct 2021 02:45:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=ip8pZk5HhXdrkWlcGrPiz6qtD8JttcdvqwaDAMypjEA=; b=YAMRiennUyvF7O/ScmMZGcRYe+onNzXNQ9bGWC7z/wBjGZ08JwX8TmMNv9BN/FWYEd viUDwApRePWodKQtf9lU1M3pdOwvDBP+q+TobJnPkeJ/Uka/ZE+KLiFiIjVuUXulIYft 9/UYu2PtQRz18+L3aNWNxnOpqcownmiTgIzCIRg1wDUDFP6vlaeYqZmwnMu7fEniJqfi 2XbwxS+bjX1cundnWOUtaQyqizkLNtPQflTbqneK6AaacqhE61cca7G76XoDqcX0VEKC mq1fjTs+c1u79N0IBxYnkT34EU/UtAmNyJjzNVFtlFEbMqI903ufgGuwvKBOz7cf0uLM qNcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ip8pZk5HhXdrkWlcGrPiz6qtD8JttcdvqwaDAMypjEA=; b=h9b83ks8NN1r2adLukEdHC4KHsJ0wYXwH7WPO8wxQiJPV0Y1DN9jRSfysgi7e/bCDC QWEtJ2z/mRRrQfOm4sdNlcCiwxcnxWI23mJh21AdryFQX11GJ5u/ICb0DA6zBT4P3Cnk 6fkMO5pricxbD6lRjebgizwG5PcfqAtumBcPhkX501r/f0453GQvRgjUGO1BG1BpEcbz AVWAry/CsPAQKACGFwYl82qCox+5+RaijsbZD70Z9yAxUEftSM9XnuUY0o30Xhc0Lbx8 QOd0Q7cOCznAZFBOYJ60vkSjmGrssMnRa/E7jxEmXJiB8ZJGP7ynqGkJDOZfvOpF4Ucw aLuw== X-Gm-Message-State: AOAM531TPT4eMY02sQBPTqzmCCA77KpVTJNtyv4/eECMol2oPAuAgRmw +IaPU34w1Wxcjw5Mww1cuiMvg1mqPGZfTQyc2vGUez9NKMc= X-Google-Smtp-Source: ABdhPJyJ6TiJ61usnKZGSTxAwdJPzYvv1rXpWL/E1gEfhA5wj6IevjtDFhn0hC2h/XvNZZpWjMhXBL7/EiFQIvLW1Vc= X-Received: by 2002:a4a:e2d3:: with SMTP id l19mr14784485oot.1.1633859151141; Sun, 10 Oct 2021 02:45:51 -0700 (PDT) List-Id: X11 List-Archive: https://lists.freebsd.org/archives/freebsd-x11 List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-x11@freebsd.org X-BeenThere: freebsd-x11@freebsd.org MIME-Version: 1.0 From: Creatxr Date: Sun, 10 Oct 2021 09:45:39 -0400 Message-ID: Subject: freebsd nvidia driver hybrid setting to startx (or startxfce4) To: freebsd-x11@freebsd.org Content-Type: multipart/alternative; boundary="000000000000511eb805cdfc7ac7" X-Rspamd-Queue-Id: 4HRxrQ4Hrwz3tFY X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=YAMRienn; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of creatxr@gmail.com designates 2607:f8b0:4864:20::c2a as permitted sender) smtp.mailfrom=creatxr@gmail.com X-Spamd-Result: default: False [0.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; FROM_HAS_DN(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-x11@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; DATE_IN_FUTURE(4.00)[3]; MID_RHS_MATCH_FROMTLD(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::c2a:from]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N --000000000000511eb805cdfc7ac7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable hi, it's a new install of freebsd 13. $ pciconf -lv | grep -A 4 vgapci vgapci1@pci0:0:2:0: class=3D0x030000 rev=3D0x06 hdr=3D0x00 vendor=3D0x8086 device=3D0x0416 subvendor=3D0x1043 subdevice=3D0x178d vendor =3D 'Intel Corporation' device =3D '4th Gen Core Processor Integrated Graphics Controller' class =3D display subclass =3D VGA -- vgapci0@pci0:1:0:0: class=3D0x030200 rev=3D0xa2 hdr=3D0x00 vendor=3D0x10de device=3D0x1391 subvendor=3D0x1043 subdevice=3D0x178d vendor =3D 'NVIDIA Corporation' device =3D 'GM107M [GeForce GTX 850M]' class =3D display subclass =3D 3D pkg install X11/nvidia-hybrid-graphics # sysrc nvidia_xorg_enable=3DYES # service nvidia_xorg start ### intel Processor Graphics is Intel=C2=AE HD Graphics 4600 pkg install xf86-video-intel pkg install libva-intel-driver pkg install libva-intel-hybrid-driver # sysrc kld_list+=3Di915kms /etc/rc.conf hostname=3D"" ifconfig_re0=3D"DHCP" ifconfig_re0_ipv6=3D"inet6 accept_rtadv" sshd_enable=3D"YES" powerd_enable=3D"YES" # Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable dumpdev=3D"AUTO" dbus_enable=3D"yes" hald_enable=3D"yes" slim_enable=3D"yes" sound_load=3D"yes" snd_hda_load=3D"yes" linux_enable=3D"yes" # not work with: kld_list=3D"linux nvidia i915kms" kld_list=3D"linux nvidia-modeset i915kms" nvidia_xorg_enable=3D"yes" fusefs_enable=3D"yes" $ kldstat Id Refs Address Size Name 1 89 0xffffffff80200000 1f11f28 kernel 2 3 0xffffffff82718000 388f8 linux.ko 3 4 0xffffffff82751000 db70 linux_common.ko 4 1 0xffffffff8275f000 10c310 nvidia-modeset.ko 5 1 0xffffffff82a00000 1e8a5a8 nvidia.ko 6 1 0xffffffff8286c000 158458 i915kms.ko 7 1 0xffffffff8488b000 7f4c8 drm.ko 8 2 0xffffffff829c5000 cbc8 linuxkpi_gplv2.ko 9 2 0xffffffff829d2000 2328 lindebugfs.ko 10 1 0xffffffff829d5000 3378 acpi_wmi.ko 11 1 0xffffffff829d9000 3250 ichsmb.ko 12 1 0xffffffff829dd000 2180 smbus.ko 13 1 0xffffffff829e0000 2340 uhid.ko 14 1 0xffffffff829e3000 4350 ums.ko 15 1 0xffffffff829e8000 3380 usbhid.ko 16 1 0xffffffff829ec000 31f8 hidbus.ko 17 1 0xffffffff829f0000 3320 wmt.ko 18 1 0xffffffff829f4000 4b60 ng_ubt.ko 19 6 0xffffffff8490b000 aac8 netgraph.ko 20 2 0xffffffff84916000 a238 ng_hci.ko 21 3 0xffffffff829f9000 25a8 ng_bluetooth.ko 22 1 0xffffffff84921000 e250 ng_l2cap.ko 23 1 0xffffffff84930000 1ce48 ng_btsocket.ko 24 1 0xffffffff829fc000 3980 ng_socket.ko 25 1 0xffffffff8494d000 30ac8 linux64.ko 26 1 0xffffffff8497e000 2260 pty.ko pkg install mesa-demos ### with kld_list=3D"linux nvidia i915kms" $ glxgears 14848 frames in 5.0 seconds =3D 2969.571 FPS 15135 frames in 5.0 seconds =3D 3026.891 FPS 15166 frames in 5.0 seconds =3D 3033.079 FPS 15007 frames in 5.0 seconds =3D 3001.273 FPS 15161 frames in 5.0 seconds =3D 3032.155 FPS X connection to unix:0.0 broken (explicit kill or server shutdown). $ nvrun-vgl glxgears 11616 frames in 5.0 seconds =3D 2323.029 FPS 11831 frames in 5.0 seconds =3D 2366.183 FPS 11816 frames in 5.0 seconds =3D 2363.154 FPS 11844 frames in 5.0 seconds =3D 2368.772 FPS 11836 frames in 5.0 seconds =3D 2367.154 FPS [VGL] ERROR: in readback-- [VGL] 259: Window has been deleted by window manager $ /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf ### not work with "nvidia" driver which setted in /etc/rc.conf ### kld_list=3D"linux nvidia i915kms" Section "Device" Identifier "Card0" Driver "modesetting" BusID "PCI:1:0:0" EndSection Section "Device" Identifier "Card1" Option "DPMS" # Driver "intel" Driver "scfb" BusID "PCI:0:2:0" EndSection Section "Screen" Identifier "Screen0" Device "Card0" EndSection #Section "Screen" # Identifier "Screen1" # Device "Card0" #EndSection ### with kld_list=3D"linux nvidia-modeset i915kms" ## with set "scfb" driver and login xorg with "Card1" $ glxgears 8536 frames in 5.0 seconds =3D 1707.060 FPS 11991 frames in 5.0 seconds =3D 2398.080 FPS 14404 frames in 5.0 seconds =3D 2880.625 FPS 14389 frames in 5.0 seconds =3D 2877.635 FPS 13999 frames in 5.0 seconds =3D 2799.666 FPS X connection to unix:0.0 broken (explicit kill or server shutdown). $ nvrun-vgl glxgears 18492 frames in 5.0 seconds =3D 3698.362 FPS 15476 frames in 5.0 seconds =3D 3095.081 FPS 14770 frames in 5.0 seconds =3D 2953.820 FPS 14932 frames in 5.0 seconds =3D 2986.189 FPS 14917 frames in 5.0 seconds =3D 2983.276 FPS [VGL] ERROR: in readback-- [VGL] 259: Window has been deleted by window manager $ ## with set "modesetting" driver and login xorg with "Card0" $ glxgears Running synchronized to the vertical refresh. The framerate should be approximately the same as the monitor refresh rate. 334 frames in 5.0 seconds =3D 66.714 FPS 301 frames in 5.0 seconds =3D 60.005 FPS 301 frames in 5.0 seconds =3D 60.006 FPS 301 frames in 5.0 seconds =3D 60.006 FPS 301 frames in 5.0 seconds =3D 60.006 FPS X connection to unix:0.0 broken (explicit kill or server shutdown). $ nvrun-vgl glxgears 15623 frames in 5.0 seconds =3D 3124.435 FPS 13787 frames in 5.0 seconds =3D 2757.238 FPS 13137 frames in 5.0 seconds =3D 2627.389 FPS 13735 frames in 5.0 seconds =3D 2746.879 FPS 13774 frames in 5.0 seconds =3D 2754.665 FPS [VGL] ERROR: in readback-- [VGL] 259: Window has been deleted by window manager $ ### I thinks that it means that it's the right setting by set driver to "modesetting" to economy power. ### but the fans still works hard, it's better switch to intel's integrated video card, but the driver "drm" or "intel" cannot work. in /var/log/messages Oct 9 15:46:44 kernel: nvidia0: on vgapci0 Oct 9 15:46:44 kernel: vgapci0: child nvidia0 requested pci_enable_io Oct 9 15:46:44 syslogd: last message repeated 1 times Oct 9 15:46:44 kernel: nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms 460.84 Wed May 26 19:58:14 UTC 2021 Oct 9 15:46:44 kernel: drmn1: on vgapci1 Oct 9 15:46:44 kernel: vgapci1: child drmn1 requested pci_enable_io Oct 9 15:46:44 syslogd: last message repeated 1 times Oct 9 15:46:44 kernel: [drm] Unable to create a private tmpfs mount, hugepage support will be disabled(-19). Oct 9 15:46:44 kernel: Failed to add WC MTRR for [0xd0000000-0xdfffffff]: -22; performance may suffer Oct 9 15:46:44 kernel: [drm] Got stolen memory base 0xafe00000, size 0x20000000 Oct 9 15:46:44 kernel: [drm] Supports vblank timestamp caching Rev 2 (21.10.2013). Oct 9 15:46:44 kernel: [drm] Driver supports precise vblank timestamp query. Oct 9 15:46:44 kernel: [drm] Connector VGA-1: get mode from tunables: Oct 9 15:46:44 kernel: [drm] - kern.vt.fb.modes.VGA-1 Oct 9 15:46:44 kernel: [drm] - kern.vt.fb.default_mode Oct 9 15:46:44 kernel: [drm] Connector eDP-1: get mode from tunables: Oct 9 15:46:44 kernel: [drm] - kern.vt.fb.modes.eDP-1 Oct 9 15:46:44 kernel: [drm] - kern.vt.fb.default_mode Oct 9 15:46:44 kernel: [drm] Connector HDMI-A-1: get mode from tunables: Oct 9 15:46:44 kernel: [drm] - kern.vt.fb.modes.HDMI-A-1 Oct 9 15:46:44 kernel: [drm] - kern.vt.fb.default_mode Oct 9 15:46:44 kernel: sysctl_warn_reuse: can't re-use a leaf (hw.dri.debug)! Oct 9 15:46:44 kernel: [drm] Initialized i915 1.6.0 20190822 for drmn1 on minor 0 $ pkg info | grep -E 'nvidia|intel' libva-intel-driver-2.4.1 VAAPI legacy driver for Intel GMA 4500 (Gen4) to UHD 630 (Gen9.5) nvidia-hybrid-graphics-0.5 NVIDIA secondary GPU configuration - Optimus Technology support nvidia-secondary-driver-460.84_1 NVidia graphics card binary drivers for hardware OpenGL rendering on secondary device nvidia-settings-460.73.01_2 Display Control Panel for X NVidia driver nvidia-xconfig-460.73.01 Tool to manipulate X configuration files for the NVidia driver $ $ pkg info -D nvidia* nvidia-hybrid-graphics-0.5: On install: Running Xorg-nvidia-headless at startup is recommended especially on mobile systems since leaving Nvidia GPU powered on with no Xorg may consume significantly more power. # sysrc nvidia_xorg_enable=3DYES # service nvidia_xorg start The Xorg instance uses separate configuration files from the defaults for Xorg: /usr/local/etc/X11/xorg-nvidia-headless.conf.d/ /usr/local/etc/X11/xorg-nvidia-headless-template.conf Only used if xorg-nvidia-headless.conf does not exist. This file is passed through nvidia-xconfig, which does not preserve all options. /usr/local/etc/X11/xorg-nvidia-headless.conf Created by manually invoking /usr/local/bin/nvidia-headless-xconfig= . Once created, this configuration is not passed through nvidia-xconfig. Configuration is not normally needed for typical OpenGL acceleration usage. A properly configured xorg-nvidia-headless.conf will allow Xorg-nvidia-headless to be started by non-superuser if Xorg has been installed setuid. nvidia-secondary-driver-460.84_1: On install: To use these drivers, make sure that you have loaded the NVidia kernel module, by running # kldload nvidia (or nvidia-modeset, see below) on the command line, or by putting ``nvidia'' (or ``nvidia-modeset'', see below again) on ``kld_list'' variable in /etc/rc.conf, either manually or by running # sysrc kld_list+=3Dnvidia (or nvidia-modeset, see below) If you build this port with FreeBSD AGP GART driver, make sure you have agp.ko kernel module installed and loaded, since nvidia.ko will depend on it, or have your kernel compiled with "device agp". Otherwise, the NVidia kernel module will not load. Also, please set correct value for ``Option "NvAGP"'' in ``Device'' section of your X11 configuration file. When building with Linux compatibility support, make sure that linux.ko module is available as well (or have it compiled in kernel). It can be loaded via /boot/loader.conf, or later in the boot process if you add linux_enable=3D"YES" to your /etc/rc.conf. If X.org cannot start and reports (EE) NVIDIA(0): Failed to obtain a shared memory identifier. in /var/log/Xorg.0.log while actually you have ``options SYSVSHM'' enabled in kernel, the sysctl ``kern.ipc.shmall'' should be increased. Starting with version 358.09, some important functionality of the driver has been broken out into a separate kernel module, nvidia-modeset.ko. Users that experience hangs when starting X11 server, or observe (II) NVIDIA(0): Validated MetaModes: (II) NVIDIA(0): "NULL" in /var/log/Xorg.0.log should replace ``nvidia'' with ``nvidia-modeset'' in their /boot/loader.conf or /etc/rc.conf configuration files, depending on how they prefer to load NVidia driver kernel module. See /usr/local/share/doc/NVIDIA_GLX-1.0/README for more information. nvidia-settings-460.73.01_2: nvidia-xconfig-460.73.01: $ $ glxinfo | grep render direct rendering: Yes GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer, GLX_MESA_query_renderer, GLX_MESA_swap_control, GLX_OML_swap_method, Extended renderer info (GLX_MESA_query_renderer): OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 4600 (HSW GT2) GL_ARB_conditional_render_inverted, GL_ARB_conservative_depth, GL_INTEL_blackhole_render, GL_INTEL_performance_query, GL_NV_compute_shader_derivatives, GL_NV_conditional_render, GL_ARB_conditional_render_inverted, GL_ARB_conservative_depth, GL_INTEL_blackhole_render, GL_INTEL_performance_query, GL_NV_compute_shader_derivatives, GL_NV_conditional_render, GL_EXT_read_format_bgra, GL_EXT_render_snorm, GL_EXT_robustness, GL_EXT_unpack_subimage, GL_INTEL_blackhole_render, GL_MESA_shader_integer_functions, GL_NV_conditional_render, GL_OES_element_index_uint, GL_OES_fbo_render_mipmap, $ dmesg | grep drm drmn1: on vgapci1 vgapci1: child drmn1 requested pci_enable_io vgapci1: child drmn1 requested pci_enable_io [drm] Unable to create a private tmpfs mount, hugepage support will be disabled(-19). [drm] Got stolen memory base 0xafe00000, size 0x20000000 [drm] Supports vblank timestamp caching Rev 2 (21.10.2013). [drm] Driver supports precise vblank timestamp query. [drm] Connector VGA-1: get mode from tunables: [drm] - kern.vt.fb.modes.VGA-1 [drm] - kern.vt.fb.default_mode [drm] Connector eDP-1: get mode from tunables: [drm] - kern.vt.fb.modes.eDP-1 [drm] - kern.vt.fb.default_mode [drm] Connector HDMI-A-1: get mode from tunables: [drm] - kern.vt.fb.modes.HDMI-A-1 [drm] - kern.vt.fb.default_mode [drm] Initialized i915 1.6.0 20190822 for drmn1 on minor 0 name=3Ddrmn1 flags=3D0x0 stride=3D5504 bpp=3D32 drmn1: fb0: i915drmfb frame buffer device $ without /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf , it cannot start xwindow. the driver must set to "modesetting". with in /etc/rc.conf set kld_list=3D"linux nvidia-modeset i915kms" ("Card0") the driver cannot set to "intel" or "drm" or "i915kms" or "mesa". otherwise it cannot startx (startxfce4) or xwindow is blank. (if set Device to "Card1", it does not work) the driver can only set to "scfb". or maybe there is no driver for intel processor integrated graphics card HD 4600 ? but it must has. # OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 4600 (HSW GT2) # [drm] Initialized i915 1.6.0 20190822 for drmn1 on minor 0 or it's a bug ? # kernel: Failed to add WC MTRR for [0xd0000000-0xdfffffff]: -22; performance may suffer what's missing or error in my config ? thanks. --000000000000511eb805cdfc7ac7--