[KUbuntu 22.04 - iGPU + dGPU] Driver installation procedure

Dear all,

I’d like to setup KUbuntu 22.04 on a desktop PC configured with:

  • iGPU: Intel UHD Graphics 630
  • dGPU: nVidia GTX 1650

iGPU will be used for X11/graphics purpose instead dGPU for CUDA computational works.

Looking for the web, I follow this procedure

1. Bios Setup

I set VGA priority in this order: iGPU - PEG - PCI

2. KUbuntu 22.04 driver setup

Once ubuntu has been installed, I did the following steps:

1. disable nouveau driver by setting its blacklist-file

blacklist nouveau
options nouveau modeset=0

and then update kernel’s

sudo update-initramfs -u

2. download official nvidia driver from nvidia XFree86 link

3. disable sddm and switch to init 3 mode

sudo service sddm stop && init 3

4. installing nvidia driver without opengl files

sudo ./NVIDIA-Linux-x86_64-525.125.06.run --no-opengl-files

5. Update/Create /etc/X11/xorg.conf with this content:

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "intel"
    VendorName     "Intel Corporation"
    BusID          "PCI:0:2:0
EndSection

where PCI id has been set in accord to lspci command.


After this, I reboot the OS, X11 correctly started but when I try the command nvidia-smi, this raise the following error:
NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver

This procedure has been read from these links:

Am I forgetting any step? Where am I wrong?

Thanks,
Nicola

Dear All,

after some troubles, I think I’ve solved.

Here are all the steps for my configuration:


Apt required’s packages

sudo apt-get install -y --no-install-recommends \
   pkg-config \
   make \
   gcc \
   g++ \
   linux-headers-$(uname -r)

Installing driver using .run file

nvdriver=525.125.06
curl -fsSLO https://download.nvidia.com/XFree86/Linux-x86_64/$nvdriver/NVIDIA-Linux-x86_64-$nvdriver.run
chmod +x NVIDIA-Linux-x86_64-$nvdriver.run

Blacklist nouveau

echo blacklist nouveau | tee -a /etc/modprobe.d/blacklist-nvidia-nouveau.conf
echo options nouveau modeset=0 | tee -a /etc/modprobe.d/blacklist-nvidia-nouveau.conf
sudo update-initramfs -u

Driver installation

The thing that let my system work, is using --m=kernel-open option.
More info on these links:

sudo service sddm stop && init 3;
sudo ./NVIDIA-Linux-x86_64-$nvdriver.run \
   --no-opengl-files \
   --no-wine-files \
   --dkms \
   --m=kernel-open

then enable NVreg_OpenRmEnableUnsupportedGpus open kernel module option:

sudo echo options nvidia NVreg_OpenRmEnableUnsupportedGpus=1 | tee -a /etc/modprobe.d/nvidia.conf

Let X11 driven from Intel / Integrated GPU only

Copy the following inside /etc/X11/xorg.conf

Section "ServerLayout"
   Identifier "layout"
   Screen 0 "intel"
EndSection

Section "Device"
   Identifier "intel"
   Driver "modesetting"
   BusID "PCI:0:2:0"
   Option "AccelMethod" "SNA"
EndSection

Section "Screen"
   Identifier "intel"
   Device "intel"
EndSection

Enable persistenced Daemon

From this link, you can initialize NVIDIA GPU and keep it enable even if there isn’t any X11 instance connected to it; this is available thanks to nvidia persistenced daemon.

Using systemctl, you can enable this daemon just creating this file inside /etc/systemd/system:

[Unit]
Description=NVIDIA Persistence Daemon
Wants=syslog.target

[Service]
Type=forking
ExecStart=/usr/bin/nvidia-persistenced --user %HERE-PUT-YOUR-USERNAME%
ExecStopPost=/bin/rm -rf /var/run/nvidia-persistenced
[Install]
WantedBy=multi-user.target

and enable it

chmod +x /etc/systemd/system/nvidia-persistenced.service
systemctl reenable nvidia-persistenced.service

Test Setup

Check if everything works in this way: nvidia-smi
and the output should be:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.125.06   Driver Version: 525.125.06   CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| 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  NVIDIA GeForce ...  On   | 00000000:01:00.0 Off |                  N/A |
| 50%   33C    P8    N/A /  75W |      6MiB /  4096MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

That’s all
Nicola

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.