szcf-weiya / techNotes

My notes about technology.
https://tech.hohoweiya.xyz/
11 stars 7 forks source link

nvidia #26

Open szcf-weiya opened 3 years ago

szcf-weiya commented 3 years ago

just note that the GPU percentage in the system monitor is NaN, and then

~$ nvidia-smi 
Failed to initialize NVML: Driver/library version mismatch
$ nvidia-settings 

ERROR: An internal driver error occurred

ERROR: An internal driver error occurred

ERROR: An internal driver error occurred

(nvidia-settings:731): GLib-GObject-CRITICAL **: 14:42:59.785: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

ERROR: An internal driver error occurred

ERROR: An internal driver error occurred

ERROR: An internal driver error occurred

ERROR: nvidia-settings could not find the registry key file. This file should have been installed along with this driver at
       either /usr/share/nvidia/nvidia-application-profiles-450.102.04-key-documentation or
       /usr/share/nvidia/nvidia-application-profiles-key-documentation. The application profiles will continue to work, but
       values cannot be prepopulated or validated, and will not be listed in the help text. Please see the README for
       possible values and descriptions.

** Message: 14:42:59.984: PRIME: Requires offloading
** Message: 14:42:59.984: PRIME: is it supported? yes
** Message: 14:43:00.024: PRIME: Usage: /usr/bin/prime-select nvidia|intel|on-demand|query
** Message: 14:43:00.024: PRIME: on-demand mode: "1"
** Message: 14:43:00.024: PRIME: is "on-demand" mode supported? yes
szcf-weiya commented 3 years ago

it might be caused by the upgrade of the kernel, such as https://zhuanlan.zhihu.com/p/166048347

szcf-weiya commented 3 years ago

try another one, the current one is the one below the selected, i.e., the 450. image

szcf-weiya commented 3 years ago

after rebooting,

$ nvidia-smi 
Sat May  8 15:11:21 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.73.01    Driver Version: 460.73.01    CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce 940MX       Off  | 00000000:02:00.0 Off |                  N/A |
| N/A   60C    P0    N/A /  N/A |    204MiB /  2004MiB |      6%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      6482      G   /usr/lib/xorg/Xorg                151MiB |
|    0   N/A  N/A      7039      G   /usr/bin/gnome-shell               49MiB |
+-----------------------------------------------------------------------------+
$ nvidia-settings 

(nvidia-settings:9103): GLib-GObject-CRITICAL **: 15:14:34.770: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
GPU at BusId 0x2 doesn't have a supported video decoder
** Message: 15:14:34.929: PRIME: Requires offloading
** Message: 15:14:34.929: PRIME: is it supported? yes
** Message: 15:14:34.968: PRIME: Usage: /usr/bin/prime-select nvidia|intel|on-demand|query
** Message: 15:14:34.968: PRIME: on-demand mode: "1"
** Message: 15:14:34.968: PRIME: is "on-demand" mode supported? yes

and note that the version has changed to 460.

szcf-weiya commented 3 years ago

Possibly due to the update on the Nvidia driver, the lock screen is no longer black.

seems not, again black.

szcf-weiya commented 3 years ago

Secure Boot

szcf-weiya commented 3 years ago

run nvidia-xconfig

DO NOT run it !!! 第二天开机时,无法进入图形界面,第一次没有出现迷茫登录界面,而第二次输入密码按回车无反应,后来按 CTL+ALT+F3 进入 tty,删除新创建的该文件,然后重启,恢复正常。

require sudo, otherwise,

$ nvidia-xconfig 

WARNING: Unable to locate/open X configuration file.

WARNING: Unable to parse X.Org version string.

Package xorg-server was not found in the pkg-config search path.
Perhaps you should add the directory containing `xorg-server.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xorg-server' found

ERROR: Unable to write to directory '/etc/X11'.

after sudo

$ sudo nvidia-xconfig 
[sudo] password for weiya: 

WARNING: Unable to locate/open X configuration file.

Package xorg-server was not found in the pkg-config search path.
Perhaps you should add the directory containing `xorg-server.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xorg-server' found
New X configuration file written to '/etc/X11/xorg.conf'

but concern about the warning, then I found the explanation in https://askubuntu.com/questions/468098/lost-nvidia-driver

the content in the file is

$ cat xorg.conf
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 460.73.01

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection
szcf-weiya commented 3 years ago

run nvidia-settings

$ nvidia-settings 

(nvidia-settings:17045): GLib-GObject-CRITICAL **: 01:04:49.563: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
GPU at BusId 0x2 doesn't have a supported video decoder
** Message: 01:04:49.720: PRIME: Requires offloading
** Message: 01:04:49.720: PRIME: is it supported? yes
** Message: 01:04:49.762: PRIME: Usage: /usr/bin/prime-select nvidia|intel|on-demand|query
** Message: 01:04:49.762: PRIME: on-demand mode: "1"
** Message: 01:04:49.762: PRIME: is "on-demand" mode supported? yes

a related issue: https://askubuntu.com/questions/1222012/nvidia-graphics-driver-problem-on-ubuntu-18-04-gpu-at-busid-doesnt-have-a-supp