# MGA / Matrox driver load



## Janusz (Aug 19, 2016)

Hi there,

Probably a silly question.. Got a Matrox G200 on my server, did my reading, identified mga as the driver, builtthe fine, built DRI as well. Loading them dynamically during boot... but how do I actually instruct the system to pick it up as VGA driver?

Based on what I've read a solution could be to use pciconf and add info as device.hint. No clue how to do this, despite going through man pages. Is that even the right route?


```
# pciconf -lv
vgapci0@pci0:1:0:1:     class=0x030000 card=0x3381103c chip=0x0533102b rev=0x00 hdr=0x00
    vendor     = 'Matrox Electronics Systems Ltd.'
    device     = 'MGA G200EH'
    class      = display
    subclass   = VGA
```


```
# kldstat
Id Refs Address            Size     Name
1   16 0xffffffff80200000 17bc718  kernel
2    1 0xffffffff81c11000 1ee0c8   zfs.ko
3    1 0xffffffff81e00000 333c     opensolaris.ko
4    1 0xffffffff81e04000 125f4    mga.ko
5    1 0xffffffff81e17000 176c9    drm.ko
```


```
# dmesg | grep vga
vgapci0: <VGA-compatible display> mem 0xf9000000-0xf9ffffff,0xfbee0000-0xfbee3fff,0xfb000000-0xfb7fffff irq 16 at device 0.1 on pci1
vgapci0: Boot video device
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
```

And BTW - the reason why I'm trying to do this is to improve transcoding speed on Plex using DRI. No X. If you've got a view on whether this will work - let me know. 

Many thanks!
Janusz


----------



## windscape (Aug 20, 2016)

Hi Janusz,

You may want to search dmesg for references for dri or mga to make sure that the kernel is detecting the card. I believe that the only benefit you may get outside of X is increased console resolution when using the vt console video driver. I don't think that Plex yet supports hardware transcoding. I believe that this is because they need to find a solution that works on all supported operating systems and that the Plex developers may not think there is much benefit when streaming. I think the only way to improve Plex transcoding speeds right now is to upgrade to a faster CPU.


----------



## Janusz (Aug 20, 2016)

Thanks for the tip Windscape. Will check for driver references. If the only way to boost transcoding speed is to upgrade CPU then it's not worth it.  I've got large video files and WLAN is struggling to cope with smooth transmission. It seems cheaper and smarter to upgrade WLAN and enjoy faster transfer across all devices (no legacy stuff so don't need backward compatibility) rather than fork out on a new CPU.


----------



## Sergei_Shablovsky (Nov 3, 2021)

Janusz said:


> Matrox G200 on my server



I have a similarly problem with using vt() console with “MGA G200e [Pilot] ServerEngines (SEP1)”.

You have a discrete graphics card or embedded ?

Which BMC You have on server ?


----------



## Sergei_Shablovsky (Nov 3, 2021)

Janusz said:


> mga.ko



As I see, You have mga.ko installed. But there are no this driver in FreeBSD 12 or even 13. 

Where You find it?


----------



## Phishfry (Nov 3, 2021)

Sergei_Shablovsky said:


> Where You find it?


I am running FreeBSD 12.2 and it is found in /boot/kernel/mga.ko

Have you tried to load it? `kldload mga`


----------



## Phishfry (Nov 3, 2021)

The Matrox driver is real old and meant for AGP Cards. So you will probably end up like this guy.
It does look like there was a drm driver at one time. mgadrm


			DriDrivers - FreeBSD Wiki


----------



## Sergei_Shablovsky (Nov 3, 2021)

Phishfry said:


> I am running FreeBSD 12.2 and it is found in /boot/kernel/mga.ko
> 
> Have you tried to load it? `kldload mga`


Wow!
Sorry my lack of knowledge and some grade Of stupidness!

Loaded by `kldload mga`, and in the list when see `kldstat`.


----------



## Phishfry (Nov 3, 2021)

Well  I can load mga as well and it shows in kldstat.
But I don't even have a Matrox card.
So loading the driver is one thing.
Having it attach to a device is another.


----------



## Sergei_Shablovsky (Nov 3, 2021)

Phishfry said:


> Well  I can load mga as well and it shows in kldstat.
> But I don't even have a Matrox card.
> So loading the driver is one thing.
> Having it attach to a device is another.



How to test properly working ?


----------

