ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > Living Room

Use video RAM as a swap disk?

(1/7) > >>

Ralf Maximus:
Found this link via BoingBoing:
http://gentoo-wiki.com/TIP_Use_memory_on_video_card_as_swap

Briefly, it describes how to set up RAM in an old video card so that Linux can use it as a fast(?) RAMdisk.  Very interesting idea, for a number of reasons I thought of:

- video ram, espcially in newer cards, can be substantial: 512MB or 1GB;

- video ram is usually optimized to be very fast, with direct CPU access and wide data paths;

- depending on hardware, you may be able to leverage insanely fast hardware memory move/copy functions, transformations, etc.  (Though I think applying hardware texture shading to a block of data would be, erm, counterproductive...)

The article leaves it as an exercise for the user to actually implement the thing, does not delve into performance much, and warns that video memory is not ECC protected and thus may not be as stable as "real" RAM.  To this I say "pish posh", but then I like to juggle flaming chainsaws in a pool of gasoline.

What are your thoughts on this?  How would you like a Windows driver that allocated half your video RAM as a swap disk?  I mean do you really need all that stuff when you're not playing BioShock?

Could one use DirectX to get at the RAM?

How feasible/desireable is this for real world applications once you get past the "holy shiat that's cool" factor?

f0dder:
Readback from video memory is "pretty damn slow" compared to regular memory, but should still be plenty faster than disk. Even 512meg is a pretty small amount for swap, though. And you'd need to be pretty careful as to how it's done to avoid losing data.

Funny that this topic re-appears, I just saw it on slashdot yesterday - but it's been discussed several months ago already. I don't personally think video card memory is viable as swap, but there might be some merit in using it for static read-cache, like the flashmem part of the upcoming hybrid harddrives...

Lashiec:
Some points:

 1) Nobody is going to buy a graphic card with 512 or 1 GB and use it solely for swapping. Mine is 256 MB and I assure you it's used for something else ;)

 2) Even if you buy a card like that, you could also buy an extra gig, I mean, you can afford it.

 3) The desktop is going to be hardware accelerated in the future, so that almost rules out this possibility.

As a gimmick it's OK, but giving all the caveats, and the hoops you have to go through to make it work, it's not worth it. I think it's better to use hybrid hardrives, and even more as they're researching things like this

Ralf Maximus:
Agreed, if you're investing in a high-end 1GB video card, you're probably the kind of person who spends most of their computer time playing games.  I was envisioning those times when most of the RAM is idle -- like when running Windowed non-DirectX apps.

And today's 1GB monster card is tomorrow's toy.  I remember when 1MB was a big deal.  "Who'd EVAR use that much video RAM?!"

Hardware accellerated desktop, aye.  Vista's already doing some of that I believe.  So maybe 2D windows' days are numbered.

Oh well, it still tickles my geek sense when folks do stuff like this.  It reminds me of those days when memory was so precious we'd steal it from the graphics system and pray the user wasn't running in a graphics mode that would notice.

f0dder:
Windows has been hardware accelerated for quite a while btw., just not using 3D.

The flash memory of hybrid drives aren't really meant for write caching as far as I understand, but rather  as a static read cache, to speed up things like boot...

Navigation

[0] Message Index

[#] Next page

Go to full version