LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-01-2011, 04:30 AM   #1
peter1234
Member
 
Registered: Apr 2009
Posts: 42

Rep: Reputation: 2
Smile Using Graphics Card Memory as Swap.


Hi Everybody,

I came across this article, which I found to be very interesting and thought share it with you all.

Graphics CardMemory as swap space or RAM disk.

http://en.gentoo-wiki.com/wiki/Using...Memory_as_Swap

Peter.

Last edited by peter1234; 06-01-2011 at 10:34 PM. Reason: Correction/info added
 
Old 06-01-2011, 04:57 AM   #2
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292
It may be interesting that it can be done, but I would say it is useless and cannot recommend it.
 
Old 06-01-2011, 04:22 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 19,618

Rep: Reputation: 3051Reputation: 3051Reputation: 3051Reputation: 3051Reputation: 3051Reputation: 3051Reputation: 3051Reputation: 3051Reputation: 3051Reputation: 3051Reputation: 3051
Neat trick. Not sure it would be actually faster than real ram. dunno, would have to see that in a test.

All memory locations are available to be used. We used to use extra space on the hard drive chips to store test data.
 
Old 06-01-2011, 04:34 PM   #4
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
O_o That just seems dangerous…what if it trashes your display contents? Although, I suppose if it doesn't touch the framebuffer…I dunno.

I'm no graphics expert, so I don't know much about the implications of using VRAM as additional system memory.
 
Old 06-01-2011, 04:54 PM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4866Reputation: 4866Reputation: 4866Reputation: 4866Reputation: 4866Reputation: 4866Reputation: 4866Reputation: 4866Reputation: 4866Reputation: 4866Reputation: 4866
Quote:
Originally Posted by jefro View Post
Not sure it would be actually faster than real ram.
VRAM is real RAM, just a different kind. It is much faster when used by the GPU, highend video cards can transfer more than 100 GB/s. The problem is that you want to use it with your CPU, so the RAM access has to be done over the PCIe interface. You will have with a PCIe x16 interface (theoretically) up to 4 GB/s (PCIe 1.1) or 8 GB/s (PCIe 2.0).
For comparison, DDR-3 (theoretical) peak transfer rates are 6.4 GB/s (DDR3-800) up to ~17 GB/s (DDR3-2133).
 
Old 06-01-2011, 11:22 PM   #6
peter1234
Member
 
Registered: Apr 2009
Posts: 42

Original Poster
Rep: Reputation: 2
I forgot to mention at the start of the thread, that Graphics Card Memory can also be used as RAM disk (in addition to swap space)
Obviously this is not for everyone, I do see may possibilities.......
-for people who like to tweak.
-people who want to squeeze every last ounce out of their system.


Standard system ram (SDram,DDR) you can either read or write at any given time.
Proper VRAM is dual ported, that is you can read AND write to same memory location at the same time (vram is more expensive to produce).
I do not know if modern graphics card memory is real VRAM (dual ported) or not.


.
 
Old 06-02-2011, 02:45 PM   #7
MBybee
Member
 
Registered: Jan 2009
Location: wherever I can make a living
Distribution: OpenBSD / Debian / Ubuntu / Win7 / OpenVMS
Posts: 440

Rep: Reputation: 57
This must be tested... for science

I have a videocard with a disgusting amount of RAM. I'll try creating a couple little RAM disks in it, and see what happens
 
Old 06-02-2011, 03:46 PM   #8
MBybee
Member
 
Registered: Jan 2009
Location: wherever I can make a living
Distribution: OpenBSD / Debian / Ubuntu / Win7 / OpenVMS
Posts: 440

Rep: Reputation: 57
Ok - testing results:

This is the videocard hdparm
/dev/mtdblock0:
Timing cached reads: 5204 MB in 2.00 seconds = 2602.61 MB/sec
Timing buffered disk reads: 100 MB in 3.01 seconds = 33.24 MB/sec

This is a 7200 RPM SATA drive
/dev/sda2:
Timing cached reads: 4516 MB in 2.00 seconds = 2258.71 MB/sec
Timing buffered disk reads: 324 MB in 3.00 seconds = 107.91 MB/sec

Couldn't do hdparm against /dev/shm (tmpfs). If anyone knows a good reliable test for that?
 
Old 06-03-2011, 04:45 AM   #9
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292
Copy a large file to /dev/shm and then run:

Code:
dd if=/dev/shm/movie.avi of=/dev/null bs=4M
174+1 records in
174+1 records out
733741056 bytes (734 MB) copied, 0.426686 s, 1.8 GB/s
 
Old 06-03-2011, 05:09 PM   #10
jefro
Moderator
 
Registered: Mar 2008
Posts: 19,618

Rep: Reputation: 3051Reputation: 3051Reputation: 3051Reputation: 3051Reputation: 3051Reputation: 3051Reputation: 3051Reputation: 3051Reputation: 3051Reputation: 3051Reputation: 3051
I was thinking versus /dev/ram0

Last edited by jefro; 06-03-2011 at 05:10 PM.
 
Old 06-07-2011, 01:07 PM   #11
MBybee
Member
 
Registered: Jan 2009
Location: wherever I can make a living
Distribution: OpenBSD / Debian / Ubuntu / Win7 / OpenVMS
Posts: 440

Rep: Reputation: 57
On my system, the dd performance to the RAM disk was actually fairly bad compared to SATA.

It was: 2147483648 bytes (2.1 GB) copied, 1.86192 s, 1.2 GB/s

So I assumed there was a better way to test.
 
Old 06-07-2011, 01:50 PM   #12
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292
Maybe this:
http://www.cs.virginia.edu/stream/

I get around 4000 MB/s.
 
Old 06-07-2011, 03:37 PM   #13
MBybee
Member
 
Registered: Jan 2009
Location: wherever I can make a living
Distribution: OpenBSD / Debian / Ubuntu / Win7 / OpenVMS
Posts: 440

Rep: Reputation: 57
Quote:
Originally Posted by H_TeXMeX_H View Post
Maybe this:
http://www.cs.virginia.edu/stream/

I get around 4000 MB/s.
Was this with GPU or system memory?
 
Old 06-08-2011, 04:01 AM   #14
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292
It's a system memory benchmark.
 
Old 06-08-2011, 07:57 AM   #15
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,078
Blog Entries: 4

Rep: Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179
The bottom line is that VRAM is intended for use by the on-board video card hardware. It's an inappropriate use, even if it "works (sic)."
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding out the memory of my graphics card dvm Linux - Hardware 6 06-16-2009 04:37 PM
Graphics card and 4G memory? HenryMUN SUSE / openSUSE 8 12-13-2006 06:56 PM
Hardware: Graphics card and 4G memory HenryMUN Linux - Hardware 1 12-12-2006 04:27 PM
Difference between Swap Virtrual memory and Swap Parition Nappa Slackware 4 11-27-2003 07:58 PM
graphics card or more memory??? esteeven Linux - Hardware 4 10-05-2002 04:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration