How to make QXL driver work

Kernels & Hardware, configuring network, installing services

How to make QXL driver work

Postby Sheriff Hobbes » 2019-08-21 05:29

Hello,

I have trouble understanding the KVM graphics acceleration, or getting QXL driver to work. From my understanding I would just need to install the package xserver-xorg-video-qxl and everything would be fine. However, I can't see QXL driver being used:

Code: Select all
lsmod |grep qxl


gives nothing. Also lshw shows no driver associated with video:

Code: Select all
lshw -c video
  *-display UNCLAIMED     
       description: VGA compatible controller
       product: QXL paravirtual graphic card
       vendor: Red Hat, Inc.
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 04
       width: 32 bits
       clock: 33MHz
       capabilities: vga_controller
       configuration: latency=0
       resources: memory:f4000000-f7ffffff memory:f8000000-fbffffff memory:fc058000-fc059fff ioport:c080(size=32) memory:fc040000-fc04ffff


modprobe gives this:

Code: Select all
modprobe -v qxl
insmod /lib/modules/3.16.0-6-amd64/kernel/drivers/gpu/drm/qxl/qxl.ko
modprobe: ERROR: could not insert 'qxl': Invalid argument


It's a kernel module, i.e. if I remove the package xserver-xorg-video-qxl, the modprobe command still gives the same message.

My questions:
1) Where is the connection between /lib/modules/3.16.0-6-amd64/kernel/drivers/gpu/drm/qxl/qxl.ko and /usr/lib/xorg/modules/drivers/qxl_drv.so, which is being installed by package xserver-xorg-video-qxl?
2) How do I load the driver to take advantage of the graphics acceleration?

Running Debian 8 with LXDE on CentOS 7.

Thanks,
SH
Sheriff Hobbes
 
Posts: 11
Joined: 2014-05-12 09:51

Re: How to make QXL driver work

Postby Segfault » 2019-08-21 21:03

This kernel of yours is incredibly old, current Linux kernel is 5.3. I suspect your kernel module error stems from this fact.
Anyhow, this is how it works. Host creates virtual hardware (unless you pass real hardware to the guest using IOMMU). Then there is kernel driver in guest OS which handles it, as kernel handles every piece of hardware. And finally, there is Xorg driver which [works with kernel module] and does the graphics. There is also MESA for 3D. All these three - kernel driver, Xorg driver and MESA must be current enough to handle the underlying hardware (in this case it is virtual hardware, but it makes no difference).
Segfault
 
Posts: 914
Joined: 2005-09-24 12:24

Re: How to make QXL driver work

Postby Sheriff Hobbes » 2019-08-22 04:33

Segfault wrote:This kernel of yours is incredibly old, current Linux kernel is 5.3. I suspect your kernel module error stems from this fact.

KVM is nothing new and kernel/drivers came with Debian and should be tested and working. Or do you mean that the KVM version in CentOS might be too high? I doubt that because I installed both CentOS 7 and Debian 8 inside of it at the same time.

Segfault wrote:Anyhow, this is how it works. Host creates virtual hardware (unless you pass real hardware to the guest using IOMMU). Then there is kernel driver in guest OS which handles it, as kernel handles every piece of hardware. And finally, there is Xorg driver which [works with kernel module] and does the graphics. There is also MESA for 3D. All these three - kernel driver, Xorg driver and MESA must be current enough to handle the underlying hardware (in this case it is virtual hardware, but it makes no difference).

If I understand you correctly, I would first need to make sure that /lib/modules/3.16.0-6-amd64/kernel/drivers/gpu/drm/qxl/qxl.ko can be loaded. Only after that I would be able to make use of /usr/lib/xorg/modules/drivers/qxl_drv.so. Is that right?
Then, how do I load qxl_drv.so? Will it be used automatically by qxl.ko? How do I check this?
Sheriff Hobbes
 
Posts: 11
Joined: 2014-05-12 09:51

Re: How to make QXL driver work

Postby Segfault » 2019-08-22 13:00

Yes.
Most kernel drivers check the hardware ID at the time of loading. For PCI devices this would be the PCI ID.
Code: Select all
00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics 630 [8086:5912] (rev 04)
        Subsystem: ASRock Incorporation HD Graphics 630 [1849:5912]
        Kernel driver in use: i915

Above example is my Intel graphics. It has PCI ID 8086:5912 and the kernel module (driver) handling it is i915.
When this driver attempts to load and the ID 5912 is listed as supported for it everything goes as expected, there will be a device node /dev/dri/card0. This node will be used later by Xorg driver. There is a Linux kernel database at cateee.net, you can check there and find out what was the first kernel version supporting this device. Earlier kernels will have i915 module, but it won't load as the PCI ID 5912 is not supported.
Xorg will load its driver automatically when it finds the device node in /dev. The probing and loading in detail is in the Xorg log.
Segfault
 
Posts: 914
Joined: 2005-09-24 12:24

Re: How to make QXL driver work

Postby CwF » 2019-08-22 14:11

Why not move up to current?
I did use QXL during Jessie. I know I used custom kernels, not for QXL as I remember.

There should be nothing to do. The host needs to define qxl as the video for the guest, the guest needs the the xorg qxl packages installed and normal os detection does the rest. Nothing fancy. There is no full 3D acceleration for QXL.
Code: Select all
root@vm:~#  lsmod | grep qxl
qxl                    77824  3
ttm                   126976  1 qxl
drm_kms_helper        200704  1 qxl
drm                   483328  6 drm_kms_helper,qxl,ttm
root@vm:~#  dmesg | grep vga & dmesg | grep qxl
[1] 20080
[    0.267951] pci 0000:00:02.0: vgaarb: setting as boot VGA device
[    0.267951] pci 0000:00:02.0: vgaarb: VGA device added: decodes=io+mem,owns=io+mem,locks=none
[    0.267951] pci 0000:00:02.0: vgaarb: bridge control possible
[    0.267951] vgaarb: loaded
[    2.849152] [drm] qxl: 16M of VRAM memory size
[    2.849153] [drm] qxl: 63M of IO pages memory ready (VRAM domain)
[    2.849153] [drm] qxl: 64M of Surface memory size
[    2.854320] fbcon: qxldrmfb (fb0) is primary device
[    2.908094] qxl 0000:00:02.0: fb0: qxldrmfb frame buffer device
[    2.924702] [drm] Initialized qxl 0.1.0 20120117 for 0000:00:02.0 on minor 0
CwF
 
Posts: 442
Joined: 2018-06-20 15:16

Re: How to make QXL driver work

Postby Sheriff Hobbes » 2019-08-23 05:43

Thanks Segfault & CwF. I got it running by updating to:
- Kernel 4.19.67
- Xorg driver 0.1.5 (xf86-video-qxl-0.1.5.tar.bz2)

Code: Select all
lsmod |grep qxl
qxl                    73728  2
ttm                   114688  1 qxl
drm_kms_helper        167936  1 qxl
drm                   434176  5 drm_kms_helper,qxl,ttm

lshw -c video
  *-display               
       description: VGA compatible controller
       product: QXL paravirtual graphic card
       vendor: Red Hat, Inc.
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 04
       width: 32 bits
       clock: 33MHz
       capabilities: vga_controller rom
       configuration: driver=qxl latency=0
       resources: irq:10 memory:f4000000-f7ffffff memory:f8000000-fbffffff memory:fc058000-fc059fff ioport:c080(size=32) memory:c0000-dffff

8)

My installation is a few years old and I just noticed it now that qxl wasn't working.
I still don't understand why it didn't work out of the box. Both CentOS and Debian were the latest versions when I installed them.
Sheriff Hobbes
 
Posts: 11
Joined: 2014-05-12 09:51


Return to System configuration

Who is online

Users browsing this forum: No registered users and 13 guests

fashionable