{{Expansion|This article may need to be expanded or revised for contemporary hardware.}}

{{Expansion|This article may need to be expanded or revised for contemporary hardware.}}

−

{{Out of date|Graphics hardware referenced is quite old at this point. rconf is referenced instead of systemd. This article primarily references a now archived article from Gentoo's wiki.}}

+

{{Out of date|Graphics hardware referenced is quite old at this point. This article primarily references a now archived article from Gentoo's wiki.}}

−

{{Article summary start}}

+

{{Related articles start}}

−

{{Article summary text|A short article on utilizing video memory for system swap.}}

+

{{Related|Improving performance}}

−

{{Article summary heading|Related}}

+

{{Related articles end}}

−

{{Article summary wiki|Maximizing Performance}}

+

Article on utilizing video memory for system swap.

−

{{Article summary end}}

+

{{Warning|This will not work with binary drivers.}}

{{Warning|This will not work with binary drivers.}}

{{Warning|Unless your graphics driver can be made to use less ram than is detected, Xorg may crash when you try to use the same section of RAM to store textures as swap. Using a video driver that allows you to override videoram should increase stability.}}

{{Warning|Unless your graphics driver can be made to use less ram than is detected, Xorg may crash when you try to use the same section of RAM to store textures as swap. Using a video driver that allows you to override videoram should increase stability.}}

Line 13:

Line 14:

A graphics card with GDDR SDRAM or DDR SDRAM may be used as swap by using the MTD subsystem of the kernel. Systems with dedicated graphics memory of 256 MB or greater which also have limited amounts of system memory (DDR SDRAM) may benefit the most from this type of setup.

A graphics card with GDDR SDRAM or DDR SDRAM may be used as swap by using the MTD subsystem of the kernel. Systems with dedicated graphics memory of 256 MB or greater which also have limited amounts of system memory (DDR SDRAM) may benefit the most from this type of setup.

−

{{Warning|The accelerated graphics bus (AGP) is a legacy bus and has a limited amount of bus bandwidth. This may limit reads to approximately 8 MB per second.}}

Warning: Unless your graphics driver can be made to use less ram than is detected, Xorg may crash when you try to use the same section of RAM to store textures as swap. Using a video driver that allows you to override videoram should increase stability.

Contents

Potential benefits

A graphics card with GDDR SDRAM or DDR SDRAM may be used as swap by using the MTD subsystem of the kernel. Systems with dedicated graphics memory of 256 MB or greater which also have limited amounts of system memory (DDR SDRAM) may benefit the most from this type of setup.

Note: Using legacy AGP (Accelerated Graphics Bus) card may limit reads to approximately 8 MB per second. AGP bus has a limited amount of bus bandwidth.

Kernel requirements

MTD is in the mainline kernel since version 2.6.23.

Pre-setup

When you are running a kernel with MTD modules, you have to load the modules specifying the pci address ranges that correspond to the ram on your video card.

To find the available memory ranges run the following command and look for the VGA compatible controller section (see the example below).

Of most potential benefit is a region that is prefectable, 64-bit, and the largest in size.

Note: The graphics card used above has 2 GB of GDDR5 SDRAM, though as indicated above the full amount is not exposed or listed by the command provided above.

A video card needs some of its memory to function, as such some calculations are needed. The offsets are easy to calculate as powers of 2. The card should use the beginning of the address range as a framebuffer for textures and such. However, if limited or as indicated in the beginning of this article, if two programs try to write to the same sectors, stability issues are likely to occur.

Warning: The following example is dated and may no longer be accurate.

As an example: For a total of 256 MB of graphics memory, the forumla is 2^28 (two to the twenty-eighth power). Approximately 64 MB could be left for graphics memory and as such the start range for the swap usage of graphics memory would be calculated with the formula 2^26.

Using the numbers above, you can take the difference and determine a reseasonable range for usage as swap memory.
leaving 2^24 (32M) for the normal function (less will work fine)