tkArena
 
Go Back   tkArena Forums > Tech Knowledge Arena > Linux Arena
Sponsored Links
TKArena Forum
Reply
 
LinkBack Thread Tools Display Modes
  #101 (permalink)  
Old 26-03-08, 12:44 PM
N00B
 
Join Date: Mar 2008
Posts: 7
gustec is on a distinguished road
Default

LAME via 3d drivers HOWTO
by brazilian dude that never gives up

First of all, sorry for the bad english.

These instructions are intended for people that cannot compile the driver with newer kernels and newer headers from the dev packages listed on ReleaseNote.txt . I cannot guarantee they will work for you, it works for ME and I only did that on a linux-2.6.24-gentoo-r3 kernel using gentoo distro. Also my case is the VT3336-3364XORG40079-kernel-src_20070611 and I really dont know if these instructions apply to other drivers.

These thing only really worked when I removed AGP support from the kernel. So you should do this too or else all OpenGL applications will segfault and cause a Oops #2 unable to handle kernel paging request at address blah. These will force the driver to use PCI instead of AGP, which is 3 times slower but its the only way I managed to make it work. I tested the driver with the linux-2.6.18 kernel and the glxgears FPS with AGP was about 220. Using PCI it gave me about 89 FPS. These are both real slow, but I think 1) the driver sucks 2) the IGP also really sucks. So dont expect to play fancy games or anything like that. if you want that, you will really have to buy a graphics card

please note: In order to compile the 3d modules you MUST have a 32 bit distribution. There are object files which must be linked to compile the module, and important shared objects that are only available as ELF 32 bit. Im talking about libS3G*.a, libGL.so.1.2, libOGL.so, libddmpeg.so and uma_dri.so. By the default installation method they are installed by the vinstall script and without these the 3d infrastructure simply does not work )

Okay, lets try this. Copy the instructions somewhere so you can have access to them, leave X if youre using it and go to the console.

instructions to compile the 2d driver
you DONT have to be root to do this

unpack the package and cd into dir
cd src/via/X11R7
chmod +w config.log
run ./config_x11r7 (this will copy the src files to the right dir)
run ./configure_xorg7.2

edit Makefile and add -DXFree86Server to the CFLAGS line
edir src/Makefile and add -DXFree86Server -DXFree86LOADER to the DEFS line

mv src/drm.h src/drm.old (this will force using the new drm header on the includes dir and not the old one that is on the src dir)

edit src/via_driver.h and add #include "via_drm.h" after the #include "via_dri.h" line

The driver should now compile fine, but it will complain about vgaHWddc1SetSpeed being an undefined symbol if you try to startx. To fix that, edit src/via_driver.c and find the following comment: "fix the "Undefined Symbol:vgaHWddc1SetSpeed" problem ". Notice there are ifdefs to test the xorg version, but they dont work and I dont know how to make then work. So simply:
change #ifdef XORG_VERSION_CURRENT to #if 1 and
change # if XORG_VERSION_CURRENT >= XF86_VERSION_NUMERIC(7,0,0,0,0) to #if 1

make

Now, as root, cp src/.libs/via_drv.so to /usr/lib/xorg/modules/drivers/

Change the driver in xorg.conf to "via"
The driver will not work yet because the 3d part is not complete. It will actually segfault when trying to set glx visuals, but if you comment the Load "dri" or Load "glx" lines on xorg.conf you will be able to use the 2d driver with no direct rendering. (I guess so, worked for me when I was testing)

So, lets make that 3d module!

instructions to compile the 3d modules
You MUST have a symlink /lib/modules/`uname -r`/source that point to your current kernel sources. Otherwise the make script will complain about not finding kernel sources. If you dont have this link, make it now.
exit (you were root, remember? dont take the root name in vain)
cd ../../3D/DRM/linux-core-release/

edit Makefile and add a line EXTRA_CFLAGS = -O2 -w to it. Then, remove the CFLAGS line. Also add a line CONFIG_DRM_UMA := m

edit drm_irq.c and find SA_SHIRQ word. change it to IRQF_SHARED. (this flag name changed in the kernel some time ago. )
do the same thing for s3g_drv.c (there are two SA_SHIRQ references on this file)

edit drm_stub.c and find the line module_param_named(debug, drm_debug, int, S_IRUGO|S_IWUGO);
change S_IRUGO|S_IWUGO to S_IRUGO|S_IWUSR|S_IWGRP
in the libS3G/ directory there are subdirs for your specific distro which contain the libS3G.a.GCC4.1.2 . This file will link with the uma module so you must copy it to the current dir. In my case Im using gentoo, so I chose the Debian version and did a
cp libS3G/Debian/4.0r0/libS3G.a.GCC4.1.2 ./
now make
if everything goes well, you should now have drm.ko and uma.ko files. These are the kernel modules for the 3d infrastructure. You should install these in the correct place so you can modprobe them. What I do is just cp drm.ko /lib/modules/`uname -r`/extra/ and cp uma.ko /lib/modules/`uname -r`/extra/ ,then I modprobe the modules.

really important shared objects that must be on the right place
the vinstall script would handle this, but since we are doing it by hand you must do it yourself.

in the 3D directory there is the DRI-Xorg_bin directory. There are files for each distribution also, so pick one subdir and
cp uma_dri.so to /usr/lib/dri/
cp libOGL.so to /usr/lib/dri/
cp libGL.so.1.2 to /usr/lib/libGL.so -> the target file may vary from distro to distro, this file is very important, the driver will not work without it. (it will segfault cause I think it sets wrong glx visuals)

also find the libddmpeg.so file that came with the driver and copy it to /usr/lib/ (its on the src/VIA-VMILIB dir)

one last step
When running an OpenGL application somebody tries to write to /var/log but he cant have permissions to do that. It will spit a blahblah *logfile* error. One way to change this is to open up /var/log write access to everybody, but this is not such a good idea. What I did was to figure out what the logfile names are and just set 777 permissions to these files. The best approach really is to create a group and put all X users in that group, then give write permissions to group
The files are
/var/log/cil_log
/var/log/cil_log_reg
/var/log/cil_log_vb

did it work?
okey. this is the exciting part. startx
hope it worked so far. now lets try glxinfo
Is direct rendering enabled?
and you should also get:
OpenGL vendor string: S3 Graphics, Incorporated
OpenGL renderer string: S3 Graphics DeltaChrome

with no segfault or Ooops #2 if you did all the steps with no AGP support at all compiled in the kernel.

Cool. Try glxgears and notice how the wheels actually spin, differently from the very slow speed of vesa driver.

I hope this helps SOMEBODY like it helped me. Im very lame so dont expect much more from my skills. Thats what I did and it works for me, so I decided to share. I know a little bit of C programming and that really helped.
Also grep was my best friend this last three days and without I would never find the answers to the compilation errors. : )

Many thanks to sandman. Without his instructions on the other topic I would not even try to do this in the first place.

Good luck to everyone that tries to do this and I hope it works.

PS: if its slow with 32 or 24 depths, try setting xorg to use 16 bit depth.

cya. :P

Last edited by gustec : 26-03-08 at 01:11 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #102 (permalink)  
Old 26-03-08, 09:40 PM
N00B
 
Join Date: Mar 2008
Posts: 3
hugolp is on a distinguished road
Default

Gustec, thanks for taking the time to write this. I will try it when I have some time, hopefully next week.

Hugo
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #103 (permalink)  
Old 27-03-08, 04:36 PM
N00B
 
Join Date: Mar 2008
Posts: 10
Antharian is on a distinguished road
Default

Gustec,

VERY GREAT Tutorial! I have one question... does the Mpeg2/4 acceleration work?

Thanks,

-A
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #104 (permalink)  
Old 27-03-08, 06:44 PM
N00B
 
Join Date: Mar 2008
Posts: 7
gustec is on a distinguished road
Default

Quote:
does the Mpeg2/4 acceleration work?
hehe a very good question
output of mpeg videos seems normal to me
but I dont know how to explicitly test for the acceleration
do you?

thanks

--gustec
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #105 (permalink)  
Old 30-03-08, 12:53 PM
Member
 
Join Date: Oct 2006
Posts: 69
antoniocaputo is an unknown quantity at this point
Default

Could you open another thread to speak about this?
Currently here we are waiting for a VIA response about the main subject of the thread... I now it is hopeless, but still this is the topic of this thread.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #106 (permalink)  
Old 30-03-08, 03:42 PM
Mr. Chris's Avatar
Moderator
 
Join Date: Jan 2002
Location: Southern California
Posts: 8,122
Mr. Chris has much to be proud ofMr. Chris has much to be proud ofMr. Chris has much to be proud ofMr. Chris has much to be proud ofMr. Chris has much to be proud ofMr. Chris has much to be proud ofMr. Chris has much to be proud ofMr. Chris has much to be proud of
Default

Gustec, Antonio has a great idea there, you should make this a seperate Topic, I can also make it a "sticky" as a guide so others can more easily find it. Chris.
__________________
1) KN9 SLI, AMD X2 6400+, 2Gb OCZ 6400, EVGA GTX260 896Mb, 320Gb + 160Gb SATA II, LG Lightscribe, 600w CM, XP Pro SP2/ Vista Home Premium
2)AX78, Phenom 9500, 2Gb OCZ PC6400, XFX 8400, CDRW, XP Pro SP2
3)AX78, Phenom 9500, 2Gb OCZ PC6400, EVGA 8800GT/SC, CDRW, XP Pro SP2
4)AX78, Phenom 9600, 2Gb OCZ PC6400, EVGA 8800GTS, CDRW, XP Pro SP2.
5)AX78, Phenom 9600, 2Gb OCZ PC6400, EVGA 7100, CDRW/DVD, XP Pro SP2.

http://www.viaarena.com/default.aspx?PageID=2VIA Drivers
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #107 (permalink)  
Old 01-04-08, 04:24 PM
N00B
 
Join Date: Dec 2005
Posts: 25
wateenellende will become famous soon enoughwateenellende will become famous soon enough
Default A little bird...

A little bird flew by my window and whispered:

" ..... VIA's HQ in Taiwan ...... ...... change and momentum to support Linux properly. ..... overhauling the support, providing proper drivers .... .... a fundamental mind-set change. ........ announcement soon."

So lets keep hope. Please do keep in mind that even if VIA suddenly becomes the most perfect company ever, it will still take months to develop new drivers or patch existing versions, and several months more before the distro's pick up the changes and we'll actually notice them. Same goes for organizing support.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #108 (permalink)  
Old 01-04-08, 04:43 PM
N00B
 
Join Date: Feb 2008
Posts: 5
Joe Henley is on a distinguished road
Default

And a Happy April Fool's Day to you, too.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #109 (permalink)  
Old 03-04-08, 12:24 PM
N00B
 
Join Date: Feb 2008
Posts: 3
cmcx is on a distinguished road
Default

any chance of a new driver anytime soon? It's been 4 months since the last release ...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #110 (permalink)  
Old 03-04-08, 03:36 PM
N00B
 
Join Date: Mar 2008
Posts: 10
Antharian is on a distinguished road
Default

Not to pick at this wound too deeply or try and agrivate it, but the Windows folks just got a new driver, March 28, 2008.

I hadn't taken notice of when their last update was, but maybe this can give us a little hope that there may be a linux release coming at some point?

VIA? Anyone there? Can someone shed any light? I've emailed them several times with no result. We would really like to use this chipset... I sure wish they would release some information about the hardware mpeg acceleration so that the opensource community could work on it!

-A
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
         All times are GMT. The time now is 05:44 PM.

LinkBacks Enabled by vBSEO 3.1.0