Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Use VRAM as System RAM before actual RAM
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Well.Heeled.Man
n00b
n00b


Joined: 25 Aug 2011
Posts: 19

PostPosted: Sat Mar 24, 2012 6:10 pm    Post subject: Use VRAM as System RAM before actual RAM Reply with quote

Hi Folks,

Just a quick question that I was pondering:

I have an Nvidia 570m with 1.5 GB of VRAM. This is considerably faster than my system RAM, and underutilized in a Gentoo system. Can I set aside say, 1GB of this as system RAM and force the system to use this before the system RAM. In normal usage, it seems that I would never really be in a position where I would need to use the system RAM and I would get a minor performance boost.

I would guess that I would need to set up some kind of block device on my VRAM that is mounted a swap, and use vm.swapiness in sysctl to encourage swapping before RAM usage. However, even with swapiness=100, it will still use my system RAM as I have 16GB of it. Does anyone have any experience/comments/guides RE: this and in particular, a way to force the system to use swap in preference to RAM.

Cheers,

Scott
Back to top
View user's profile Send private message
eccerr0r
Advocate
Advocate


Joined: 01 Jul 2004
Posts: 3599
Location: USA

PostPosted: Sat Mar 24, 2012 7:03 pm    Post subject: Re: Use VRAM as System RAM before actual RAM Reply with quote

Well.Heeled.Man wrote:

I have an Nvidia 570m with 1.5 GB of VRAM. This is considerably faster than my system RAM,

I don't quite understand this. Video graphics card memory has additional latency to access - system RAM is always faster. Video RAM (with bus latency) however is faster than hard drive, so you can always swap to it with benefit

Swap is swap. This means the system actually uses real system RAM and then "swaps" it out to secondary storage, whether it be hard disk or video memory. Of course this is slower than just using real RAM.

However, since you have 16GB RAM there's no need for swap.

Not sure where you see where the performance boost. At best PCI/PCIe/AGP memory is memory mapped and you can access the mapped area directly without paging... but as swap you lose any speed benefit as it will need to copy from/to the storage.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed to be advocating?
Back to top
View user's profile Send private message
Well.Heeled.Man
n00b
n00b


Joined: 25 Aug 2011
Posts: 19

PostPosted: Sat Mar 24, 2012 7:18 pm    Post subject: Reply with quote

Using it a swap was just how I envisaged it working, but I see what you mean. I was not thinking about the additional latency; I was only thinking about the fact that my VRAM is overclocked DDR5 @ 1900mhz and my RAM is DDR3 @ 1333.

Is it possible to directly map the PCIe VRAM? Obviously this would have implications for the GPU, but I am not sure I need more than 0.5GB VRAM for non-gaming workloads.
Back to top
View user's profile Send private message
eccerr0r
Advocate
Advocate


Joined: 01 Jul 2004
Posts: 3599
Location: USA

PostPosted: Sun Mar 25, 2012 5:47 pm    Post subject: Reply with quote

It takes several tens of cycles to access the first byte for PCIe, then the memory controller on the video board has its own latency to deal with, which is probably not much different than DDR3 overall. The sum of the two will probably be worse than the DDR3 by itself.

This isn't really worth it in my opinion. The latency will kill overall. And not even mentioning the bandwidth of PCIe versus a direct memory controller connection.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed to be advocating?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 31344
Location: 56N 3W

PostPosted: Sun Mar 25, 2012 6:53 pm    Post subject: Reply with quote

Well.Heeled.Man,

With well designed software and a decent amount of on chip CPU cache, you rarely get a CPU stall waiting for main memory.
Instead the cache hit ratio is over 95% and CPU cache is full CPU core speed.

It may not be possible to cache VRAM in th CPU. That would mean the CPU has to snoop on what the GPU does to its VRAM, which sounds expensive in terms of bus bandwidth
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
ToeiRei
Veteran
Veteran


Joined: 03 Jan 2005
Posts: 1152
Location: Austria

PostPosted: Mon Mar 26, 2012 11:18 am    Post subject: Reply with quote

I once used the Graphic cards memory as a block device for keeping swap files... Wouldn't that solve your problem somehow?
The howto I used back in 2006: http://my.stargazer.at/2006/04/10/graphikspeicher-als-storage-verwenden/

maybe that helps
_________________
Blog | btrfs | Please stand by - The mailer daemon is busy burning your messages in hell...
Back to top
View user's profile Send private message
boerKrelis
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 234
Location: The Netherlands

PostPosted: Mon Mar 26, 2012 11:49 am    Post subject: Reply with quote

The VRAM is wicked fast *from the perspective of the GPU*. From the CPU, writing to it isn't quick and reading is even slower (it's not really a use case to read textures *back* from VRAM).
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 2384

PostPosted: Mon Mar 26, 2012 12:30 pm    Post subject: Reply with quote

I've heard that from a cost perspective, you may just be ahead to get a small SSD for use as a swap device.
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
i92guboj
Moderator
Moderator


Joined: 30 Nov 2004
Posts: 9752
Location: Córdoba (Spain)

PostPosted: Mon Mar 26, 2012 12:38 pm    Post subject: Reply with quote

Any of the specs that you read for your graphics vram is referred only to it working in conjunction with your gpu, not the main cpu. In any chain, the strength of it is defined by the strength or the weakest link, in this case, the bus. If your reasoning was right, then there'd be no sense in having memory slots. We'd just plug the ram into the pcie or agp slots and be done with it.
_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum