Convert Unneeded VRAM Into A Storage Device 244
Pawel Kot writes "Have you ever thought why does your graphics card has so much memory? Do You think you have not enough RAM or awfully slow swap file? Do you need fast ram-disk or diskless machine? Go for it! Take one of these cheap 128MB graphics cards and enjoy the speed. Michal Schulz wrote a good description on how to take the advantage of not used video card memory."
I can't help but think.... (Score:5, Insightful)
I'll stick with buying RAM and using my graphics card for what it was designed for. Besides...this only applies to X users anyway.
Re:I can't help but think.... (Score:1)
Rock on
Re:I can't help but think.... (Score:2)
Re:I can't help but think.... (Score:1)
Re:I can't help but think.... (Score:1)
There has to be some kind of seti-style challenge which could be optimized for the types of calculations that a good graphics card does. Anyone?
Re:I can't help but think.... (Score:1)
The art would be improved if there was some way to use the memory as a display buffer AND as a disk. I think it might look pretty neat to watch a grep -r work on that puppy.
Reading from a display buffer doesn't affect what you see, so nothing would visibly happen during the grep.
Re:I can't help but think.... (Score:2)
One good pedantic answer deserves another:
If the inode table were onscreen, the "last access" date would be getting reset all over the place.
(Incidently, I used to run programs on the Apple ][ like this - flip over to hgr or gr and watch them execute).
--
Evan (no reference)
Re:I can't help but think.... (Score:2)
Re:I can't help but think.... (Score:3)
its one of those mountains geeks climb because its there.
geel == geek appeal ??? (Score:2)
Never heard this one before. If it's a typo you may have just coined new jargon.
What the hell can I do with that? (Score:1, Redundant)
What the hell can I do with that?
Well, many things. When I was thinking about it, I have found two ways to use it. One of them is making any filesystem on that and mounting it somewhere, the other is more sophisticated:
meehow:~# mkswap
meehow:~# swapon
Later on, more possibilities occur. You can use this methon in X11 terminals, to limit network bandwitch for example. During bootup such terminal would load kernel and compressed filesystem. The FS may be placed then on such mtdblock device and kernel may boot from it. Using console-only server with some kind of modern 32MB gfx card may use the vram as huge swap (which is way faster than swap on disk). New ideas are welcome
Re:What the hell can I do with that? (Score:5, Informative)
Re:What the hell can I do with that? (Score:5, Interesting)
not_cub
Re:I can't help but think.... (Score:2, Interesting)
It's currently being employed as a database and fileserver. There is a possible project coming up where the database will be quite a bit larger--768 will probably be used up--but this is not really essential. A ramdisk may be necessary. I could go out and buy a new machine, but I don't have to. I could use this fun method. This is a nifty solution for a ramdisk.
Are there any PCI cards on the market that are made just for this purpose? e.g. not a video card, but just a PCI card with DDR or DIMM banks and maybe a controller (not talking about those cpu/dimm pci machine on a card setups).
Re:I can't help but think.... (Score:2)
Re:I can't help but think.... (Score:2)
They even support Linux
Re:I can't help but think.... (Score:2)
Re: Oh, it can be useful all right (Score:2, Interesting)
I just happen to have a nVidia geForce2go which I'm using in vesa mode becasue the nvidia module is proprietary...
Now I can swap to the video memory I'm not using and put that memory to use.
How about using that video memory for
I just don't understand why people are so negative when people have come up with a new way to show just how flexible the linux kernel can be... just because some feature doesn't meet your needs doesn't mean it doesn't meet mine.
If you want a one size fit all solution, then try some of those companies in the northwest part of the country.
Re: Oh, it can be useful all right (Score:1)
Sort of like when the guy cut and pasted an advertisement as a Slashdot article, it's the spirit of the submission that leads to the likely response. In this case the submission basically argues that one should use a "cheap 128MB video card" as RAM, yet in my neck of the woods I can buy over a GB of DDR333 RAM for less than I can buy a 128MB videocard. It just was a really nonsensical way of wording that.
Re:I can't help but think.... (Score:1)
Re:I can't help but think.... (Score:4, Informative)
Besides...this only applies to X users anyway.
That's not true. You don't need to use X to do this, you just need a video card. In fact, if you're just using the machine in console mode, you may as well use your video memory for swap or something.
Re:I can't help but think.... (Score:4, Funny)
Next week: Using the new fangled chipped-and-removable 4MB CMOS ICs (as found in Gigabyte's dual BIOS) to trade files with your friends in lieu of floppy diskettes. Nevermind the price tag.
Re:I can't help but think.... (Score:2)
Re:I can't help but think.... (Score:2)
Temporary use of VRAM (Score:3, Informative)
Most of the drivers and TSRs that I wanted to load in the space originally allocated for monochrome video (a 32K block between B0000 and B7FFF) required more space to load than to run so I came up with the solution of 'borrowing' some VRAM and wrote the Video Hole package to do just that. I used a BIOS call to change the display page from 0 to 6 (for reasons I never quite understood, 7 didn't work on my old Trident 8900) and 'borrowed' 24000 bytes (6 pages of VRAM) from the VRAM to allow a program (say MSCDEX?) to fit in there, then 'recalled' the loan, changing back to page 0. That extra 24K more than took care of the transient portion of a lot of programs that otherwise couldn't use the Video Hole.
I don't know if anyone else ever used the darned thing (nobody ever sent me the $5 shareware fee for doing so) but it got uploaded to a bunch of BBSes and works in the real mode phase of Win95 and 98 - if you have hardware with real mode drivers that don't know how to load low and relocate the resident portion high, it will do the job fine.
Been there, done that (Score:2)
Re:I can't help but think.... (Score:3, Interesting)
sometimes we get servers thrown in our laps that already have gfx cards which aren't needed. my last Sun came with 128mb video card plus an onboard 64mb card. i don't use either one since i use serial console on the thing.
I'm working on cd's that will install themselves into memory filesystems [blackant.net]. Problem is, to get a decent set of apps i need a lot of memory. Using vram would be very nice, maybe not for a machine that i would spec out since i'd buy it with enough RAM, but what about borrowing/hijacking machines? Imagine using this cd to go to library, boot computer from cd, cd ejects (so there's no trace of you since upon reboot, mem is wiped), you walk on. what you left behind: a machine running gnutella and using memory file systems to store files on. getting more space from the vram would be essential.
Re:I can't help but think.... (Score:2)
No, it isn't.
Booting a publicly accessible computer from a CD is not illegal, and running gnutella is not illegal.
-
Isn't this what Quartz Extreme is all about? (Score:4, Interesting)
Rather than buy an extra card for this purpose, the question to ask is how much of that 128MB am I using day-to-day. If the answer is *none* (as Apple determined) then this is a good thing.
Re:Isn't this what Quartz Extreme is all about? (Score:2)
Re:I can't help but think.... (Score:2)
So I can swap onto it. Or use it for
BTW, geek challenge: Use opengl2 shader instructions to do something useful other than accelerate games - bit parallel math cruches for compression video, say. Or crack DES3.
Dave
Dur... (Score:5, Insightful)
If you're THAT low on memory, you're not likely to have a 128 meg video card.
Or a 64 meg card, even.
-l
Wow! Useful AS! (Score:5, Funny)
Or maybe not...
Re:Wow! Useful AS! (Score:2)
Re:Wow! Useful AS! (Score:2)
Now all we need is some really cool hacker to write a neato virus for us... Any volunteers?
ram cheap too... (Score:1)
Re:ram cheap too... (Score:1)
Chances are... (Score:3, Interesting)
I strongly doubt you would buy a fast processor with an agp motherboard (needed for the card), and desperately needed memory so badly, that you take from the 128 mb video card.
Re:Chances are... (Score:2)
Of course this is still more expensive than all RAM except for RDRAM (which is about the same price) so is still silly. And yes, most people who oen 128MB video cards own something like a GeForce 4 and can thereofr afford to back that up with plenty of system RAM.
Re:Chances are... (Score:2)
Re:Chances are... (Score:2)
Not long ago, I built a new Athlon XP desktop box (Win98, non-taxing business apps and light browsing) with a 64 meg S3 card, with s-video and composite NTSC outputs, some motion compensation bullshit, and terrible 3D performance. My old V3 2000 smoked it on just about everything during a comparative burn-in session, with a K6-2.
The V3 has 16 megs of RAM. The S3 has four times as much. And since it's nearly useless for anything OpenGL and it's driving a fixed 1024x768 LCD, it's never going to use more than 4 megs of that RAM for a framebuffer.
I picked the S3 because it was -cheap-. Cheaper than 32meg nVidia cards, cheaper than off-brand Voodoo3 cards made in Korea with surplus, post-nVidia GPUs, cheaper than Trident, cheaper than a Riva128 or a 2 meg Matrox, or any of ATi's available offerings.
I realize that S3 is dead, and will always be (thanks, SonicBlue - and I'll never have an empeg now, either). But the driver is stable, and the machine will be running the same install of 98 until some catastrophic hardware failure makes cause for something different. As long as it performs acceptably with IE's smooth scrolling features, and the wind-up start menu included with 98SE, all is golden.
So, cheap&stable is the order of the day.
If I were building a headless Linux box instead of a more interactive machine, I'd have chosen the same card. I reiterate: I could not find a cheaper AGP video card from any retailer that I was purchasing other items from. (gotta factor in shipping costs, yaknow...)
Getting ~60 megs of really fucking fast swapspace -for free- sounds like a winner, to me. And if you still think it's a bad idea, search Slashdot for old discussions of using CompactFlash cards as swap. Talk about silly, expensive means of adding virtual RAM...
I'd run something like this in a heartbeat on a headless machine, or one not destined for 3D work. Noone needs 16 megs, let alone 32, 64, or 128 just for a framebuffer. Might as well do something useful with it, even if it is slightly more expensive than an equal-capacity DIMM.
It is, once again, free.
anyone remember velvet jones.... eddie murphy snl? (Score:2)
i usually could care, but this post reads like ghetto yoda.
Next week on Slashdot... (Score:5, Funny)
Re:Next week on Slashdot... (Score:1)
Re:MOD PARENT UP FUNNY (Score:1, Offtopic)
I keep seeing the offer of crack for moderators.
Where do I go to get mine?
No (Score:1)
Have you ever thought why does your graphics card has so much memory?
No, I haven't. That's probably because I think in proper English. "Why does your graphics card has so much..."
How 'bout this? "Have you ever thought, 'why does my graphics card have so much memory?'"
Re:No (Score:1)
Is probably better.
Re:No (Score:4, Insightful)
Is probably better.
The best option, however, would be to not pick on the grammar skills of an English-as-a-second-language writer, unless you care to put your Polish language skills on display for us all.
Re:No (Score:1, Offtopic)
Re: (Score:1)
Don't knock it, it's still a cool hack. (Score:3, Insightful)
It's a cool hack, simple as that.
Why not knock it? (Score:2)
Some people love hacking their cars, but they don't use their gas tank to hold their washer fluid simply because it's possible to do so.
- A.P.
yah - works well (Score:3, Insightful)
Re:yah - works well (Score:2)
This might be true in theory but its not even close to true in practice. Memory access via AGP only hits about 10% of its theoretical maximum with current video cards. And read speeds are attrocious because the videocard designers assume there's going to be lots of data going from the CPU to VRAM but not much coming back.
So, to parrot all the other posts saying this, this hack is completely useless, regardless of any cool factor you might find in it. There's absolutely no way I can imagine anyone finding a REAL use for this in practice.
Re:yah - works well (Score:1)
2. For a 2D desktop you will have spare video card ram.
3. Use this video ram in preference to HDD swap.
Re:yah - works well (Score:1)
Re:yah - works well (Score:2)
Ah... (Score:1)
Re:Ah... (Score:1)
I know, like the time I reformatted my harddrive. I moved my OS into RAM (I had more RAM than harddrive at the time) reformatted, put it back.
I didn't even need a reboot.
Cool hack... (Score:1)
Well, that's probably what makes it a cool hack ;-)
speed? (Score:4, Interesting)
On another note, this would be usefull for older machines that only have SIMMS and use EDO/FP RAM which is a lot more expensive than todays SD/DDR RAM. But, alas, those old machine don't have AGP ports. So, really, I don't see the point to this.
Re:speed? (Score:2)
There's some PCI cards out there. I don't know how much memory they have (mine GF2PCI has 32 meg). Quick check reveals some 64Meg cards, which is not bad (compared to 64Meg SIMMs..).
Bigger problem IMO is power consumption. GF2 seems to eat some juice even without heavy 3D. Also if you have some rather shitty PCI cards, you really have to choose place of grapphics card well, SB live was one example of this b0rkiness. Anyway, 5PCI slots, 1 for real use and 4 x64meg each. that would be nice..
Also look at the speed of VRAM vs. RAM (Score:1)
where as VRAM on most cards with 128meg of VRAM range from 600Mhz-700Mhz. So would there be a bottleneck accessing this VRAM from the AGP bus as opposed to RAM from the FSB? (I believe the AGP runs at 66Mhz still?)
Re:Also look at the speed of VRAM vs. RAM (Score:1)
Forget reliability if you do this... (Score:1, Insightful)
Hm. (Score:2)
- A.P.
Re:Hm. (Score:2)
Old School DOS Memory Managers (Score:1)
<JOKE>
So I guess Linux is finally catching up to DOS.
</JOKE>
Re:Old School DOS Memory Managers (Score:4, Interesting)
Re:Old School DOS Memory Managers (Score:2)
IF you have a program that can write outside that space for graphics operations, and you remap just about everything, you could theoretically get most of the first meg as conventional -- in theory only or in short run tests where you don't care what works or how well it works.
Re:Old School DOS Memory Managers (Score:2)
Re:Old School DOS Memory Managers (Score:2)
Video memory typically starts at A000, and can start lower. Video ROMs are typically at C000-C800. B000-B800 is for monochrome (MGA). With that trivia out of the way...
While the book you quote is good, you're out of your element. For one, I don't need to quote his book as I was there and know what I'm talking about .
Loading something somewhere means nothing if it can't survive there. Adapters can initialize from A000-10000h without warning the OS or memory manager. This means corrupted programs or data. To use one piece of memory or another required much machine-specific tinkering. To use a contiguous block required quite a few rare circumstances.
Loading anything above 1M leads to the program thinking (rightly) that it is still in the first meg. -- and it will attempt to write into the first meg if it can be executed at all. Usually, it can't. _DOS_ programs in the first meg run in real mode meaning that they will do things that are illegal in protected mode unless rewritten. _All_ programs above the first meg run in protected mode or don't run at all. (Nit: A small space called the HMA at 1M+ through 1M+~64K can still execute in real mode, though they would have to be patched or they would still attempt to write into the first 64K.)
Once you handle all those problems in your code you end up with a protected mode program that no longer needs real mode. No real mode, no reason to use the first meg -- just allocate the memory from the OS/memory manager and let it mess with the first meg if it needs to. That's why DOS sucked so bad -- no memory to do jack unless you avoided it entirely.
I worked at Qualitas -- makers of 386MAX (similar to QEMM). I debugged and tested MAX, compressed system BIOSes, a seperate 286 memory manager (yes, they existed), and a memory diagnostics program (RamExam). Shulman's book is a wee bit thicker because of the work that I and a few others at Qualitas did using debuggers that could do odd things like boot DOS from DOS -- not a big deal now, but an unreal thing to design back in the day unless you had specialized hardware.
Why swap/storage? (Score:1)
Occasionally I have delusions of trying something like this - treating the division between the VRAM and regular RAM as a case of non-uniform memory access, and using existing algorithms to prefer the faster memory.
Not *completely* useless. (Score:1)
Prior Art (Score:2, Interesting)
This goes to show how virus authors's creativity evolves pretty fast, its funny how nowadays someone is showing how to use VRAM for legitimate purposes. Who would have known? Those crazy VXers thought of it first.
Re:Prior Art (Score:2, Funny)
Re:Prior Art (Score:2)
Re:Prior Art (Score:2)
Anyways again, if the 'virus' was in RAM, then swapping a video card would erase the virus, because that usually requires a powercycle of the card...
I'm guessing that at your LAN parties you had a virus that spread through the harddisk and FLASH ROM on particular brands of video cards. Some clown must have written a virus specifically to spread during LAN parties... Who else would use a video card they just met without protection?
what about my X? (Score:1)
Re:what about my X? (Score:1)
They tried this on the Dreamcast (Score:1)
He had this wonderful idea of allocating the frame buffer and then using the excess video memory to store extra data.
It failed miserably when he realised that you can't actually read from the Dreamcast's VRAM, only write.
I for one (Score:1)
Hidden Security (Score:2, Interesting)
Write a fast bitblit routine to erase the "hidden memory. Use the graphic engine to add real time xor of crypto keys.
Don't think of it as just memory but think of it as secret memory.
Shaun
I like the idea. (Score:1)
Although I don't have a lot of VRAM to spare, this gave me an idea I might play with...
I have an old 486DX4 system, with one of those cool AMD 486 processors with double L1 cache and Write-Back (WB) cache mode. (Trust me, these 486's are much faster than the rest of the pack). There's only one problem though: the motherboard has very few L2 cache (256k), which makes it unable to cache more than 32MB of RAM in WB mode. So, to put in more memory, I would either have to switch to Write-Through (WT), which would be slow, or have a mix of cacheable and non-cacheable memory, which is even slower.
What does all this have to do with the mentioned article, you might wonder? Well, it immediately gave me the idea that I might be able to add more RAM to that PC, use the lowest (cacheable) part for the system, and use the above as a Memory Technology Device (MTD), perhaps putting some swap space on it. Weird, huh? Still, if it works, it'll probably be somewhat better than leaving the extra memory in a drawer gathering dust...
Too bad I'll be travelling in a few days, so my spare time right now is next to zero. *sigh* But I'll have to try it sometime.
This used to be useful, once upon a time. (Score:2, Interesting)
Of course there's a big difference between boosting a maxed out XT and expanding the capacity of your P4 2.8Ghz from 2GB to 2.064GB.
Excellent hack (Score:2)
Great place to place viral code? (Score:3)
Just kidding. No one would be nasty and put viral code where no scanner has gone before.
128 megs!!! (Score:2, Insightful)
Why so much RAM? (Score:2, Interesting)
Re:Why so much RAM? (Score:2)
Why do operating systems require so much memory? They don't. You can get onto the internet with a 486DX/33, 340MB IDE hard drive, 16MB RAM, 14" VGA monitor, Windows 95 (or Linux 1.x), and 14.4Kbps modem. Floppy drive optional.
In fact, about two or three years ago, I bought a system like that for $50 ($25 for the 486 PC and $25 for the VGA monitor). I used it as a web server, after I dug up a USRobotics Courier v.34ter (33.6K) external modem. I upgraded the flash ROM on the Courier to support 56Kbps, got a dial-up account at a local ISP, and installed RedHat 5.2 (the oldest RedHat CD I could find after searching for five minutes). The CDROM, one of the hard drives, a serial port, and some other miscellaneous hardware failed after a while, but it kept chugging on, until I finally replaced it with a DEC Multia.
Why do operating systems today use so much RAM? Because of the User Experience. If you want to have a bunch of services (or daemons) running in the background, you're going to need lots of RAM. Do you want your applications to load quickly? Well, one option you have at your disposal is to partially load the application at bootup, then keep that portion in memory permanently. That eats up a lot of memory. Maybe you don't use the application so often, but you don't want it to take five minutes or more to load. Well, you can cache frequently accessed data, the directory structure, extended attributes, etc. Depending on how efficient your cache is, you can get away using small amounts or huge amounts of RAM. Of course, the law of diminishing returns applies here, as well.
Speaking of efficiency, take a look at the programs written for MS DOS in the early 1980s. Most of them were written in assembler. When people started using higher level languages, the memory footprint increased (tremendously, in some cases, where inexperienced programmers did not optimize their code at all, allowing that faster processors and more memory would cover up their experience). When developers use object oriented, interpreted, high level languages, the memory footprint explodes and the execution speed becomes unbearable, except under the fastest processors. Try running a large Java application on your 486/33 or Pentium 75. I bet it won't run too quickly.
Why does the operating system provide all these services, features, and user experience goodies? Because users want the operating system to do so. If you don't, then try using a real-time, microkernel based operating system. QNX is an example of this. MSDOS, a glorified program loader, is a somewhat decent example of a minimalist kernel distributed with the bare minimum of tools necessary to boot up a PC. It probably couldn't even boot up some modern PCs, given that it is a 16 bit real-mode app, and we're pushing the boundaries of 32 bit computing.
In short, features suck up bandwidth, speed, and memory. You can't run XP on a 486, because it preloads IE6 (and other apps) into memory at bootup, caches everything, runs as resolutions unsupported by your Trident 8900C video card, and has so many things popping up, sliding away, and running in the background, your poor 486 processor and ISA video card would be unable to keep up.
Nobody said you had to upgrade beyond your 486/33 and MSDOS 6.x. It still works just fine, I'm sure, and you'll probably notice that WordPerfect for DOS loads up extremely quickly.... much faster than Office XP does.
Why do people upgrade? They want programs to have talking, dancing paper clips. WordPefect for DOS doesn't even have a single wizard, just a text help screen.
We've been here before actually (Score:2)
Even my A3000 can do this with Cybervision (RTG software) once fast ram was used up it could use the memory on the video card as zorro expansion memory (ie memory attached to the system expansion bus).
Neat thing was it did this all dynamically and automatically - without you having to specify space or anything.
Re:We've been here before actually (Score:2)
Some models came only with chipram as default.
Running programs from "chipram" was slow, since the CPU was unable to access it and would have to wait whenever any of the other chips accessed it.
When you allocated memory, you could choose to request a specific type of memory (if you needed the memory to be accessible to the auxilliary chips, you'd request chip ram, if you needed the speed you'd request fastram) or not care, in which case fast ram was allocated unless there was no big enough block of fastram available.
Re:We've been here before actually (Score:2)
servers anyone? (Score:2)
No.
Do I have a video card sitting in my AGP slot?
Yes.
Is there a legitimate reason -not- to use that card for something at least?
NO!!!
Sure, my desktop has 512 MB RAM, and 64 MB VRAM, I don't need to dip into that extra RAM, but for my server, that's 4 more MB that I have available now before I have to access a terribly slow swap file. Besides, isn't this the main use of *NIX anyway, webserving? All modern PCs have AGP slots now, if you run your own server, and it has a PII or newer, chances are good it has AGP support, at -least- 1x. Chances are also good you have a video card lying around. So why not do something cool with it, rather than collect dust?
Just a thought guys.
if only.. (Score:2)
cool, now all we need is... (Score:2)
Gamecube audio ram (Score:2, Insightful)
Combine with slow disk swap? (Score:2)
BUT: What if I put 60 MB swap on this fast VRAM-swap, and another 256 MB swap on an old, rotten and slow IDE drive? Will Linux detect that the first swap is faster and make extensive use of it, or will the slow 256 MB swap ruin my performance anyways?
Re:Amazing.... I'm flabbergasted! (Score:2)
Heh, study history, what cyou think EMS/XMS memory was? Sure it did not connect over the (yet to be conceived of) PCI bus, but that is how it worked, plug the card into the expansion slot and. . . .
Ah, here is a nice quote
--- http://members.iweb.net.au/~pstorr/pcbook/book2/m
Re:Go home please, Linux kernel (Score:2)
PS> As for the comments about my intelligence and my spelling:
1) I've known DirectX since I was in the tenth grade. Learned Win32 just after I learned the C++ standard library.
2) I just got off summer break, it was late at night, and I was typing that on a laptop keyboard, so fuck off!