Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

How to make QXL driver work

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
Sheriff Hobbes
Posts: 11
Joined: 2014-05-12 09:51

How to make QXL driver work

#1 Post by Sheriff Hobbes »

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

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

Re: How to make QXL driver work

#2 Post by Segfault »

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).

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

Re: How to make QXL driver work

#3 Post by Sheriff Hobbes »

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?

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

Re: How to make QXL driver work

#4 Post by Segfault »

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.

CwF
Global Moderator
Global Moderator
Posts: 2680
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 196 times

Re: How to make QXL driver work

#5 Post by CwF »

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

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

Re: How to make QXL driver work

#6 Post by Sheriff Hobbes »

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.

Post Reply