# Getting the framebuffer to work with nvidia graphics cards

## TheCoop

Ok, I have tried and tried to get the framebuffer working with my gf4 ti, and have finally found the solution:

kernel config:

whether you use the nvagp driver or the kernel agpgart depends on your motherboard chipset, which can be found here: http://www.gentoo.org/doc/nvidia_tsg.html#doc_chap2

disable or enable the agpgart support in the kernel depending on your chipset, enable processor mtrr support, and enable all the usual framebuffer options (listed in the framebuffer howto), DISABLE the rivafb module but ENABLE the vesa module (and no other gfx card modules), and recompile the kernel

in your /boot/grub/menu.lst, add the following to the end of your kernel boot line (with bzImage...):

vga=ask video=vesa:ywrap,mtrr

reboot. A menu should come up with all the strange 640x480 modes listed, but instead enter 0317 at the prompt, to give you a 1024x768x16bit console resolution (even though it isnt in the menu)

hopefully the logo should come up at the top!

if it works, edit menu.lst so this is on the kernel line:

vga=791<change if needed> video=vesa:ywrap,mtrr

----------

## Tuxisuau

There's no need to disable the agpgart and the mttr.

(Here with a 600MHz athlon / Asus K7V motherboard / VIA KX133 chipset / GF4 MX440)

----------

## TheCoop

some chipsets need the nvagp driver, and the mtrr driver improves performance

----------

## voidzero

 *Tuxisuau wrote:*   

> There's no need to disable the agpgart and the mttr.
> 
> (Here with a 600MHz athlon / Asus K7V motherboard / VIA KX133 chipset / GF4 MX440)

 

It is here...

----------

## TheCoop

nvagp/agpgart depends on your chipset 

ive updated the origional post for this

----------

## Tuxisuau

I trust more kernel's agpgart than nvidia's one. In my machine, it's probed to be more stable this way. (with nvidia agpgart I get random hangs)

----------

## voidzero

Is there any way to get 1152x864 or even 1280x1024 fb resolution? I tried various other modes but they don't work?

----------

## Kruuse

Thank you, TheCoop. You just made me very happy.  :Smile: 

Now I use:

vga=791 video=vesa:ywrap,mtrr 

(791 = 0x0317)

Cheers,

Jens

----------

## arkane

 *vocis wrote:*   

> Is there any way to get 1152x864 or even 1280x1024 fb resolution? I tried various other modes but they don't work?

 

I'd love to know that, also.  I tried 31B, but that doesn't seem to work. (according to the /usr/src/linux/Documentation/fb/vesafb.txt file, 31B is 1280x1024-16k colors.)

Maybe I'll try 31A, which is 1280x1024-64K colors... (I still have "ask" on right now, so I can experiment)

----------

## Tuxisuau

I have the same problem... 31B mode never worked on me. Maybe we should file a kernel bug.

----------

## voidzero

I think not -- I'm using the nvidia-driver not the xfree driver anyway.

----------

## arkane

 *vocis wrote:*   

> I think not -- I'm using the nvidia-driver not the xfree driver anyway.

 

Huh?  You've lost me...

You never really use the nvidia driver at all until your in xfree.  Everything is taken care of by the vesafb.

----------

## voidzero

hmm... ok I thought it was one and the same module but I guess I'm mistaking there.. never mind  :Smile: 

Mark

----------

## ghost_o

 *vocis wrote:*   

> hmm... ok I thought it was one and the same module but I guess I'm mistaking there.. never mind 
> 
> Mark

 

Right, the video=vesa has to be video=riva to use the rivafb ( fb driver for riva and geforce cards) -- also, vga=372 (whatever you use) will not work, you have to pass the kernel:  example:  video=riva:1024x768-16@60

RivaFB support must be compiled intot he kernel for this to work.

----------

## nitro322

According to the nvidia README:

 *Quote:*   

> Using both rivafb and the NVdriver kernel module at the same time is currently broken.  In general, using two independent software drivers to drive the same piece of hardware is a bad idea.

 

So, if we can't use rivafb, and the nvidia driver isn't used until loading X, how exactly do we get the accelerated framebuffer?  I have fb working on my computer using plain VESA, but obviously it's not accelerated.  Thanks.

----------

## TheCoop

you can't. you have to use the vesafb module to get a framebuffer at all

----------

## arkane

These are things we need to think about with the coming of xdirectfb to Gentoo.  I would love to get my console running at 1280x1024 before that  :Smile:   (I've used the masked version, but I can't get a console bigger than 1024x768.. that and Quake3 won't start because it can't find some extensions)

But a framebuffer larger than 1024x768 would rock for xdirectfb.

----------

## TheCoop

try adding '"Load" "extmod" to your x86config file in the modules section (this first one)

----------

## nitro322

 *TheCoop wrote:*   

> you can't. you have to use the vesafb module to get a framebuffer at all

 

Oh.  Hmm... I thought this thread was about getting it to work specifically for the nVidia hardware (as in accelerated), not just generic VESA.

----------

## TheCoop

it is. you cant use the rivafb module and the NVdriver module at the same time, you, have to use the vesafb for the console and the NVdriver for X. That is how you get nvidia cards working

----------

## dioxmat

btw. the rivafb module is hardware accelarated I believe, and the vesa one is not. so dont plan to use things like mplayer :)

(however Id be curious to know if anyone ever tried xdirectfb with a nvidia card with the vesa or rivafb module...)

----------

## arkane

 *dioxmat wrote:*   

> btw. the rivafb module is hardware accelarated I believe, and the vesa one is not. so dont plan to use things like mplayer 
> 
> (however Id be curious to know if anyone ever tried xdirectfb with a nvidia card with the vesa or rivafb module...)

 

I've used xdirectfb with my nvidia card using the vesa.. I can't remember if I've tried using rivafb, I probably have.  It works, but Quake3 dies out on me, complaining about not having the proper extensions. (go figure, it's not an accelerated x server)  Other than that, it starts up sweet, has a very snappy feeling to it, and gives you an all around "apple" style feel. (with the responsiveness)  I do believe it's the way of the future, honestly.  Either that, or some other derivative.

I just want something larger than 1024x768 LOL!!!

----------

## arkane

 *TheCoop wrote:*   

> it is. you cant use the rivafb module and the NVdriver module at the same time, you, have to use the vesafb for the console and the NVdriver for X. That is how you get nvidia cards working

 

I was going ot leave this go, but I just can't.. it needs correcting.

the framebuffer stuff (rivafb, and vesafb) are purely console and are mutually exclusive from the NVdriver module.  They don't need each other, and as a matter of fact they don't even know about each other.  You can use the rivafb module together with the NVdriver module, because they are in different modes.  The only downfall to it is the artifact left on the cursor when you drop out of X.  (XServer is not cleaning up after itself properly, according to the docs on framebuffer)  But, thats not a problem with incompatibility, it's a problem with the xserver.

----------

## TheCoop

i stand corrected

----------

## kode54

I haven't tried mplayer with framebuffer, but I have no problem using its vesa driver, even with high resolution videos. (-vo vesa)

----------

## kvh009

I have a nvidia geforce2 and have followed the above instructions.  When I reboot and for example, pick 80x40, the terminal automatically changes to that.  However, I still don't have a /dev/fb0.  I can't figure out why...

Do I have to do something with devfs to get it to work?  

```

(kvh@rachael)-(13:21)-(~)> ls /dev/fb*

/dev/fb0-            /dev/fb2current-     /dev/fb5autodetect-

/dev/fb0autodetect-  /dev/fb3-            /dev/fb5current-

/dev/fb0current-     /dev/fb3autodetect-  /dev/fb6-

/dev/fb1-            /dev/fb3current-     /dev/fb6autodetect-

/dev/fb1autodetect-  /dev/fb4-            /dev/fb6current-

/dev/fb1current-     /dev/fb4autodetect-  /dev/fb7-

/dev/fb2-            /dev/fb4current-     /dev/fb7autodetect-

/dev/fb2autodetect-  /dev/fb5-            /dev/fb7current-

/dev/fb:

```

 :Mad: 

----------

## TheCoop

try typing 0317 at the vga selection screen

----------

## butters

I have never gotten a framebuffer console working under gentoo on my box with a GeForce2 MX card. 

I compiled with the settings suggested (MTRR and the settings from the framebuffer HOWTO).  Compiled X, then the nvidia modules, modified the grub.conf file, and still the modes available are things like 80X25 and 80x50.

Typing 0317 or passing vga=791 doesn't work.  This has to be a kernel level problem, because the console is created before modules are loaded in init.  And, for this reason I made sure to compile the kernel settings into the kernel directly, rather than as modules.  Typing 'scan' at the mode selection prompt does verify that the console vga driver is vesa, but there are no vga modes and <sigh> no tux logo.  Help?

----------

## alyent

What about refresh rate? Howto make it to be 85 Hz???

(nv geforce2mx400)

----------

## _SkeLeToN_

Well I was able to get framebuffer with works with my nvidia Geforce 2 MX 400.

This what I did : in the kernel config I use those setting 

 *Quote:*   

> 
> 
> CONFIG_FB=y
> 
> CONFIG_FB_VESA=y
> ...

 

All the other or set to N 

I use lilo so in my vga is : vga=0x307 which is 1280x1024*256

Also I now have a great lilo animated boot screen yeah  :Smile: 

By the way why would need 16K or 32K color in console ... I only use console for administrating my box so no need extra color.

Oh and the nvidia Frame Buffer is a real pain when you have to switch back and forth from X to console with ctr-alt-F1 to F6 got alot of garbage.

If you need more vga mode look under : /usr/src/linux/Documentation/fb/vesafb.txt

Cya

----------

## _SkeLeToN_

 *alyent wrote:*   

> What about refresh rate? Howto make it to be 85 Hz???
> 
> (nv geforce2mx400)

 

Since you dont specify which one you uses so just tell you about the standard one.

If you use vesa you wont be able to change the refresh rate...

This is what vesa says about refresh rate 

 *Quote:*   

> Refresh rates
> 
> =============
> 
> There is no way to change the vesafb video mode and/or timings after
> ...

 

----------

## iwasbiggs

Using a geforce 2mx 400, I was able to get 1280x1024x32k using the vga=794 (or, 031A on the ask screen) before the other, previously stated, kernel parameters. 31B (32bit) Wasn't recognized under vga=ask, so I didn't try it.

This is using grub btw.

----------

## ghoti

Hi !

Just replaced my old card with a new GF4 ti4200-8x.

No problem to get 1280x1024 with either vga=0x307, 0x319, 0x31a or 0x31b.

Moreover, I also tried 0x346 (=838) witch I discovered in the SuSE SDB.

And, bingo : 1600x1200 !  :Smile: 

But, amazingly, the "official" codes (796,...) are not accepted !?!

----------

## TheCoop

accepted as in do not work?

----------

## Lowspirit

I'd love to compile in framebuffer support for console but it seems to default to a resolution/hz that my monitor doesn't support cause it simply blacks out, system still doing it's thing in the background.

In 2.5.x kernel console framebuffer and framebuffer is separated, but still in the USE="" you have to put fbcon, but can I still use this? I have /dev/fb and all that set and ready to go, but my console doesn't use framebuffer.

----------

## TheCoop

have you tried putting 'vga=ask' in the bzImage grub.conf line?

btw, in the 2.5 kernel, does the riva framebuffer driver and nvdriver play well together?

----------

## carambola5

 *alyent wrote:*   

> What about refresh rate? Howto make it to be 85 Hz???
> 
> (nv geforce2mx400)

 

Try this:

```
kernel <bzImage location> root=<root location> [options] vga=<vga setting> video=vesa:mtrr:1024x768@85
```

I don't know if 85Hz will work, but mine works at 70.  Here's my line in grub.conf:

```
kernel /boot/bzImage.05 root=/dev/hda4 append="hdc=ide-scsi" vga=792 video=vesa:mtrr:1024x768@70
```

Granted, it doesn't give me what I wanted (splash screen aka "tip of the year"), but it gives me a framebuffer correctly.

----------

## ghoti

 *TheCoop wrote:*   

> accepted as in do not work?

 In fact, this codes are rejected as "invalid" and I'm asked to choose a valid code or to "scan".

The codes above 1280x1024 are not mentionned in the kernel doc (vesafb.txt) but they are wel described in the framebuffer-HOWTO.

I'm using xfs-sources-2.4.19-r2.

I've not searched further since 0x346 is OK.

----------

## seaweed

 *carambola5 wrote:*   

>  *alyent wrote:*   What about refresh rate? Howto make it to be 85 Hz???
> 
> (nv geforce2mx400) 
> 
> Try this:
> ...

 

Replace:

```
vga=792
```

With:

```
vga=791
```

You will then get the splash screen images, assuming you set it up correctly.

----------

## _SkeLeToN_

 *arkane wrote:*   

> 
> 
> I just want something larger than 1024x768 LOL!!!

 

Don't know why you have so much problem.  I'm running 1280x1024x256 with vesafb.  I know its not 64K but in console mode black and white dont need that much   :Wink: 

Anyways in my lilo.con I put 0x307 and I dont have any problem.

The only thing I hate with vesa I can't get a refresh rate higher than 60 ...

Anyways for now i'm happy.

----------

## rb338

Didnt see this topic before I posted a solution for the refresh rates, so heres the link:

https://forums.gentoo.org/viewtopic.php?p=237075#237075

I got my framebuffer on 1280x1024 @ 85 Hz, with a Geforce4  :Smile: 

----------

## squidly

Has any one tried and succedded with splitting the concole on to 2 monitors with the framebuffers and a nvidia gforce4 mx440? I know that under X its possible with the twinview.. (that is a pain with two different monitors of different sizes!)  

To respond to some of the other posts I dont use X all that much I just use it when I need a LOT of terms open.. (usualy when Im doing a lot of code hacking) so I like a lot of colors on the Framebuffer.

Thanks

----------

## static_void

I have a quick question....mtrr registers are used bye the NVdriver to speed up shit, but in your grub.conf if you assign video=vesa;x:mtrr...Will they free them up when NVdriver tries to access them or will they just not and Nvdriver will not get them?>

----------

## pubecon

sorry static_void but this isn't a reply to your message

when I add the 

 vga=ask video=vesa:mtrr

parameter  with grub (in the grub.conf file or at the grub prompt) the background colours of the grub gentoo splash screen just go psychadelic on me and everything stops.  admittedly I haven't waited for more than 10 minutes for anything to happen, but then again i don't want to

I do however want a high resolution console.  It is so frustrating seeing it load automatically with my package remastered knoppix cd and then coming back to huge land for gentoo.

as an aside, I followed the nvidia troubleshooting guide and it appears I am best suited to NVAGP and so I edited my XF86Config file as such (with a "1" option I believe) and also built the nvidia kernel through the ebuild by exporting the relevant variable...BUILD_PARAMS=something ...however a dmesg outputs 

"0: NVRM: not using NVAGP, AGPGART is loaded!!"

fluxbox loads fine so I am wondering whether I just shouldn't be trying to fix something that isn't broken.

----------

## TheCoop

disable agpgart in the kernel and recompile. Do you get as far as asking what console text you want?

----------

## pubecon

ok, now here I suspect is where I'm stupidly going wrong with the fundaments of it all so bear with me.

I thought that I was disabling agpgart in the kernel with the BUILD_PARAMS=NOAGPGART (or whatever it was equal to, you know which variable I mean) and then recompiling.

oh, and I don't get as far as what console text I want.  I hit enter after the grub command and then the display goes all altered-coloured on me and nothing else happens. I can hear no hard disc activity.

----------

## TheCoop

what does it say in menuconfig?

----------

## pubecon

now I feel real bad for taking up so much real estate in the tips and tricks forum....

ok, so now I'm just going to look damn silly I think.

To install the nvidia module for my needs I just followed the desktop setup documentation and emerged nvidia-kernel and nvidia-glx (which I since upgraded to 4xxx [the latest in portage]).

I've never found a directory where it would be possible to make menuconfig for the nvidia kernel which is where I've possibly gone wrong...

...and I can't find any agp related option in my vanilla-source menuconfig but then it is quite easy to miss some options

[edit]

via an april 2002 post (https://forums.gentoo.org/viewtopic.php?t=9049) I discovered various framebuffer options in the kernel that I wouldn't have spotted otherwise I don't think.).  won't know what difference enabling those options will make for a wee while yet although suddenly, in lacking vga support in the kernel for the console the freezing when being passed the vga=ask parameter makes more sense.

[/edit]

----------

## phlashback

I'm still investigating this, but hears the problem. I have used the vesa frambuffer w/ my visiontek gforce4 Ti4600 since I got it about a year ago, w/ no problems. I run dual amd 1900+ on a tyan 2462 MB. I had 2 of my banks filled w/ 256MB Regesterd DDR (512 Total) all was well.

I just added a 512MB Regesterd DDR module, and I no longer get a fram buffer... Instead my system boots w/ blank screen ( I can Use X) but I have only blank consolse. I had run memtest 86 on the system for 48 hours prior to booting linux w/ out issue. So far I have found that after trying ever combination, I f I leave 1 of the 256 MB modules out The Fram buffer works.....

An body heard of this..... 

When I go to work tonight I am going to snag memory from another puter,m and see if that make the difference... but for now I am completely confused

btw I have tried w/ kernels {2.4.20-gentoo, 2.4.20-gaming, 2.5.66, 2.5.66-mm3}

Thanks fo any assistance

----------

## phlashback

Update to previous.... Have not had chance to swap memory yet..... but, a freinds lent me his ATI Radeon 7500... frame buffer works w/it... aprently it is a videocard problem..... hmmmm

Any suggestions

----------

## DefconAlpha

I use mplayer to play stuff in plain 80x25 console when X fscks up. Try using svgalib to play

```
mplayer -vo svga [file]
```

works :) (eeh, mostly anyways)

----------

## pYrania

Well i just got the 1280x1024x16M fbmode running with

```
vga=0x31B video=vesa:ywrap,mtrr
```

----------

## taskara

anyone know what I need to get framebuffer (1024x768@16bit) working on a dell inspiron 8200 laptop with ati radeon 9000 ?

ta!

----------

## pYrania

I'd say you don't need anything more than the vesa framebuffer kernel module.. err installed into kernel .. whatever i am drunk  :Smile: 

well compile vesa framebuffer support into your kernel and set your grub options like mine.

----------

## taskara

ta.. I'll give it a go!  :Wink: 

----------

## pYrania

goddamn i am impressed seeing mplayer playing movies with the svgalib and no x server running.

I never thought this would be possible.

Thanks for the hint, DefconAlpha.

----------

## carrett

i don't know if anyone else has had this problem, i'm using the nvidia drivers with a gf4 and my relevant boot parameters are:

```
vga=791 video=vesa:ywrap,mtrr
```

and i see the logo fine and X loads great, but when i exit X i see these funky lines moving down the screen, things still work and text is still readable. anybody know what's up?

----------

## taskara

lol... still trying to get framebuffer working on my nforce!

----------

## phlashback

taskara:

If you dont mind my asking.... how much memory do you have on you nforce board, and how much videomemory on your video card.

also are you trying to use vesafb......

https://forums.gentoo.org/viewtopic.php?p=274717#274717

if you have => 832 MB RAM.... the link above may help

Good luck

----------

## carrett

i have 512mb on the card...i don't know about the board...

----------

## taskara

 *phlashback wrote:*   

> taskara:
> 
> If you dont mind my asking.... how much memory do you have on you nforce board, and how much videomemory on your video card.
> 
> also are you trying to use vesafb......
> ...

 

hey plashback, I have a gig of ram and the card has 128Mb.. going to the link now..

thanks!

----------

## carrett

this isn't the same problem though, i'm just having the moving lines, i can see and type, and it only happens when i EXIT X, before i load X, everything's nice and pretty and the way i like it....so....i don't know what to do....

----------

## phlashback

taskara:

I will almost garuntee that your problem will be solved by the patch that i made  :Wink: .... given that I had my framebuffer dissapear when I went from 512 to 1024, and after some poking around, and looking into the lkml I found this as the hack around (I dont take credit for the fix, just turning it into a patch.. and bringing it to these forums)

good luck.. and let me know if you have any problems with it

carrett:

just for arguments sake, do you by chance have the rivafb compiled in the kernel.. if so remove it.  are you sure about the 512 MB being video memory, sounds a bit large for that   :Laughing:   but then again I could be wrong.. I have been before  :Embarassed: 

Unfortunatly I personaly have not experience  this, so I am at a loss.... maby try a diffrent version of the nvidia drivers.... 

good luck to you as well, and sorry I cant be more of a help on your problem

----------

## carrett

i'm trying to see if i can't get a screenshot so you all can see what i'm talking about.

----------

## phlashback

carrett:

get fbgrab..... read the manual entry, and it shuld help you get your screen shot   :Wink: 

----------

## carrett

http://www.ocf.berkeley.edu/~carrett/images/error.png

i guess fbgrab doesn't show the error i'm seeing. there are lines running down my monitor, i can still read everything and the console's perfectly usable, it's just kinda annoying. anyone got a better fb screenshot utility that might show what i'm talking about? anyone had this problem??

----------

## taskara

could be a refresh rate problem ??

----------

