Why doesnt system use idle vram?

amenx

Diamond Member
Dec 17, 2004
4,406
2,727
136
Just wondering, outside of gaming, is our vram essentially wasted? Sure theres a little bit used for desktop composition, theme effects, but with 4gb+ GPUs common now, cant the system make use of it? Say if one has 4gb system ram + 4gb GPU, when system runs out of memory, can it dip into vram to cover its needs? If not, why? Question been on my mind ever since GPUs crossed the 1gb mark.
 

Tuna-Fish

Golden Member
Mar 4, 2011
1,646
2,467
136
In theory, you could, but you probably don't want to. The reason for this is that the extra ram lives behind a relatively low-bandwidth and high-latency PCI-E link, making it much slower to access for the CPU than your main RAM.

There have been various projects that do things like put ramdisks on your GPU, but those are really more like programmer toys than they are useful tools. RAM is so cheap that if you are running out in your normal workloads, it's better to just get more than it is to try to jerry rig GPU ram for the purpose.
 

PrincessFrosty

Platinum Member
Feb 13, 2008
2,300
68
91
www.frostyhacks.blogspot.com
No, memory is only useful in the contexts of the processor which uses it, remember that all high speed memory is connected to some kind of processor, with system RAM it's connected directly to your CPU, so the CPU reads out of this RAM, calculates values and puts the results back into RAM.

Same for the GPU, the GPU reads directly from vRAM and does calculations and stuffs the results of those back into vRAM.

The link (Bus) between the CPU and RAM, or the GPU and vRAM is extremely high speed in order provide such fast processors with a constant flow of data, the link between the GPU and the rest of the system such as the CPU, runs over a relatively slow and laggy bus (the PCI-E bus)

The only real way you can make use of vRAM is when you actually do the calculations on the GPU itself, which we're doing more and more, you'll see hardware accelerated video playback, hardware accelerated flash player in browsers, and other such things, there's also lots of other specialized apps which can use the GPU and in fact run much faster on a GPU like bitcoin mining, password cracking and things like that.

Generally speaking the GPU is much better at specific tasks, those which are highly parallelizable and so it's these kinds of tasks that people tend to build GPU apps for. Outside of that, there's no easy way to use vRAM as extended system RAM, it's just too far away from the CPU, to slow and too laggy to be of any use for real time processing, there's already solutions for extending system RAM and that's using a pagefile on the HDD or SSD.
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
Besides the above:

Even with just 4 GB, almost no single application uses all of your system RAM, except for games. If you're gaming the VRAM is in use.

Most non-game code is 32-bit which can't use more than 2 GB without jumping through hoops, and how often do you need to open a 3 GB Word document? (Hint: never.)

For multiple applications, Windows can use disk space for holding the memory used by inactive applications in the swap file. Using VRAM instead would just speed up the delay for waking up the inactive app. With an SSD the difference isn't going to be enough to matter very often.
 

amenx

Diamond Member
Dec 17, 2004
4,406
2,727
136
No, memory is only useful in the contexts of the processor which uses it, remember that all high speed memory is connected to some kind of processor, with system RAM it's connected directly to your CPU, so the CPU reads out of this RAM, calculates values and puts the results back into RAM.

Same for the GPU, the GPU reads directly from vRAM and does calculations and stuffs the results of those back into vRAM.

The link (Bus) between the CPU and RAM, or the GPU and vRAM is extremely high speed in order provide such fast processors with a constant flow of data, the link between the GPU and the rest of the system such as the CPU, runs over a relatively slow and laggy bus (the PCI-E bus)...
Thanks for the explanation guys.. makes perfect sense.
 

lamedude

Golden Member
Jan 14, 2011
1,222
45
91
Only 256-512MB is mapped to the CPU. That might change when 32bit dies. The AMD RAMDisk does not use GPU RAM either.
 
Dec 30, 2004
12,553
2
76
this is a good idea/question. If you have a 3GB card, why not get the benefit of the other 2.5GB? PCI-E2.0 x16 is still 16GB/s of bandwidth. Plenty fast.
 
Dec 30, 2004
12,553
2
76
No, memory is only useful in the contexts of the processor which uses it, remember that all high speed memory is connected to some kind of processor, with system RAM it's connected directly to your CPU, so the CPU reads out of this RAM, calculates values and puts the results back into RAM.

Same for the GPU, the GPU reads directly from vRAM and does calculations and stuffs the results of those back into vRAM.

The link (Bus) between the CPU and RAM, or the GPU and vRAM is extremely high speed in order provide such fast processors with a constant flow of data, the link between the GPU and the rest of the system such as the CPU, runs over a relatively slow and laggy bus (the PCI-E bus)

The only real way you can make use of vRAM is when you actually do the calculations on the GPU itself, which we're doing more and more, you'll see hardware accelerated video playback, hardware accelerated flash player in browsers, and other such things, there's also lots of other specialized apps which can use the GPU and in fact run much faster on a GPU like bitcoin mining, password cracking and things like that.

Generally speaking the GPU is much better at specific tasks, those which are highly parallelizable and so it's these kinds of tasks that people tend to build GPU apps for. Outside of that, there's no easy way to use vRAM as extended system RAM, it's just too far away from the CPU, to slow and too laggy to be of any use for real time processing, there's already solutions for extending system RAM and that's using a pagefile on the HDD or SSD.

??? even PCI-E 1.0 bandwidth is 8GB/s, which is fine, and much better than any HDD or SSD. do you guys just reply without even thinking anything through?
 

Smoblikat

Diamond Member
Nov 19, 2011
5,184
107
106
Just wondering, outside of gaming, is our vram essentially wasted? Sure theres a little bit used for desktop composition, theme effects, but with 4gb+ GPUs common now, cant the system make use of it? Say if one has 4gb system ram + 4gb GPU, when system runs out of memory, can it dip into vram to cover its needs? If not, why? Question been on my mind ever since GPUs crossed the 1gb mark.

I doubt it would perform better than a dedicated SSD pagefile, I bet it would actually run much slower.

The RAM on a GPU is stuck behind a processor and a PCI-e bus, making latency significantly higher than regular DRAM. If you are running out of memory and for whatever reason cant put more in, buy a cheap 32gb SSD and dedicate the entire thing to a pagefile.


??? even PCI-E 1.0 bandwidth is 8GB/s, which is fine, and much better than any HDD or SSD. do you guys just reply without even thinking anything through?

Bandwith =/= latency

EDIT - Also just thought of the fact that the latency of GDDR5 is MASSIVE compared to the DDR3 used in most computers today. It does have really high clocks to offset that, but in my experience I notice faster response with tighter timings, rather than higher frequency with RAM.
 
Last edited:
Dec 30, 2004
12,553
2
76
I doubt it would perform better than a dedicated SSD pagefile, I bet it would actually run much slower.

The RAM on a GPU is stuck behind a processor and a PCI-e bus, making latency significantly higher than regular DRAM. If you are running out of memory and for whatever reason cant put more in, buy a cheap 32gb SSD and dedicate the entire thing to a pagefile.




Bandwith =/= latency

EDIT - Also just thought of the fact that the latency of GDDR5 is MASSIVE compared to the DDR3 used in most computers today. It does have really high clocks to offset that, but in my experience I notice faster response with tighter timings, rather than higher frequency with RAM.

No it's not
 

RampantAndroid

Diamond Member
Jun 27, 2004
6,591
3
81
edit: nevermind. I don't feel like explaining

Think of this a bit more: not only is it latency, you'd also need a way to tell the GPU that memory ranges X to Y are no longer owned by the GPU, they're owned by the CPU. And the GPU would need a way of saying "No, I need that now, page that out and give me those ranges back".

It's generally cheap these days to stick gobs of DDR3 RAM into a system. I do wonder if, one day, our non-volatile memory (aka, SSDs or whatever replaces them) will become as fast as volatile memory and thus negate the need for system RAM entirely.
 
Dec 30, 2004
12,553
2
76
no, look at the latency in real-world seconds. Compare DDR1-400 to DDR2-800 to DDR3-1600

then you'll understand why you're wrong about GDDR5

I don't know what the latency of PCI-E is, but it's definitely going to be much faster than an SSD, which you shouldn't even be running a swap file on. If you have a swap file on a spinning-platter HDD, GDDR5+PCI-E is DEFINITELY going to be faster, no matter what.

This would actually be a selling point for me on the 390/390X.
 
Last edited:

RampantAndroid

Diamond Member
Jun 27, 2004
6,591
3
81
no, look at the latency in real-world seconds. Compare DDR1-400 to DDR2-800 to DDR3-1600

then you'll understand why you're wrong about GDDR5

I don't know what the latency of PCI-E is, but it's definitely going to be much faster than an SSD, which you shouldn't even be running a swap file on. If you have a swap file on a spinning-platter HDD, GDDR5+PCI-E is DEFINITELY going to be faster, no matter what.

This would actually be a selling point for me on the 390/390X.

I'm not sure what you're getting at (post some links, I'd be happy to read.)

CAS timings on DDR3 and GDDR5 are not the same - GDDR5's CAS timings are around double that of DDR3; you make up for this by running the GDDR5 at much higher speeds.

Additionally, it isn't just the timings of the memory or the latency of the PCIe bus, but how do you access the memory? Is there a direct way to address the VRAM over PCIe, or do you have to go through some memory controller? I suspect the latter, and you might end up with contention there, right? If the GPU is presently doing rendering or compute work that relies on VRAM access and the CPU suddenly starts to demand lots of reads/writes to the VRAM, then you'll have contention...and either the CPU, GPU or both will lose.

And I circle back to somehow needing to be able to tell the GPU's memory controller that rangex X to Y are no longer your data, and you cannot access them (and have a way for the GPU to page those out to use those ranges when it needs to.)

Also, why would you not put your page file on an SSD? Longevity is the only reason I can think of, and it's generally accepted (I think) that the number of reads/writes a pagefile will generate over time isn't going to really erode the life of the SSD by that much. Sure, a ramdisk is better...but so is adding more system RAM?
 

ElFenix

Elite Member
Super Moderator
Mar 20, 2000
102,393
8,552
126
I doubt it would perform better than a dedicated SSD pagefile, I bet it would actually run much slower.

very doubtful that this is correct. NAND flash is likely much slower in terms of nanoseconds to access, and takes much much longer to write to than volatile ram. a GDDR5 pagefile would destroy an SSD based pagefile. that's not even taking into account a graphics card is typically hooked up to 16 lanes of pci-e bandwidth.

I do wonder if, one day, our non-volatile memory (aka, SSDs or whatever replaces them) will become as fast as volatile memory and thus negate the need for system RAM entirely.
companies have been working on this stuff for decades, probably ever since computing moved away from core memory to semiconductor memory.
 

Dufus

Senior member
Sep 20, 2010
675
119
101
https://devtalk.nvidia.com/default/topic/534776/how-using-gpumemory-for-zram-or-ramdisk/

Video cards are meant to have a good inbound speed (cpu -> videocard), because you upload textures to it, the opposite is often not true.
In my tests i've got about 10MBps when reading from videoram.
I tested a 7900GT, a 9500GT and an ati 7200.
The fastest was the ati.

Another problem you will face when using gpu memory as system one, is that you could write in some areas that are currently used by the graphic driver, so you will end up with a corrupted screen.

Ati opensource driver allows you to limit the amount of memory used by the graphic, and with a few calculations you are able to avoid conflicts, but this is not possible with nvidia blob, so you're out of luck anyway, maybe nouveau allows this, but the speed problem remains.