Linux Swap- TIP- how to get virtually infinite Ram memory

Hello, i’m writing this post because i’ve not found that thing written anywhere, maybe it is just too obvious, but tried yesterday and completely change my rendering performance.

So we all know that when blender gets low on ram it simply crashes, well yesterday i was playing with grass and my poor 8gb ram couldn’t simply handle the amount of grass i needed for my scene.

over 292000 particles(path) and 10 children it simply crashed. i was looking at the ram consuming in order to get an idea on how much i could increase it, when i noticced that it didn’t crash at reaching the 8gb ram, but the 8 gb + the 3 gb of swap i had allocated.

So tried givin him 25gb of swap from the ssd disk and BAM!

could render at 3000000 particles, it just take some time when loading, it used the 8gb ram + 22 gb swap!

Well this thing is going to change my life(blender speaking)! it means i can handle very very complex scenes,
currently i am rendering on CPU, as i have the integrated graphic card. next week it’s going to arrive the gtx970 and i really hope this swap thing will work either on GPU rendering, it would simply mean you could render any complex scene on the gpu no care of the ram.
So if someone have any idea on if it goes also on gpu and eventually how to enable it, please write it down, found anything on the internet.

So, For the ones who have no idea on how to enable another swap partition, let explain the thing:

Fist, you need to have a partition to play with in your ssd.
then
apt-get install gparted

gparted is a graphical tool that let you edit your partition be VERY careful on what you do, it is a mass destruction weapon.

Identify the partition you want to use for the swap, or re-dimension it in order to have litteler partition for swap (like 20gb) and the rest for datas. before doing this copy all the data from the iterested partition on other disks of course!

Than right click on the partition you want to use as swap and go to format. in the File ssytem tipe select “linux-swap”.
click apply all changes, then right click on the same partition and click enable as linux swap.

Now you have Temporarly enabled the swap since the next reboot. make a try on rendering, and let’s see on hoe to enable it permanently.

open up a terminal
then sudo nano /etc/fstab
paste inside this line# /dev/sda7
UUID=your_partition_uuid swap swap sw 0 0

change “your_partition_uuid” to the uuid of your partition, to find out wich is, go back to gparted, right click on your partition and click on informations.
the pop up will show you various things, one of them is al line like that:
UUID: 94384803-1592-4c0f-a600-7189b3d9e497

so copy the number in the file you opened with the terminal in order to make your line like that one:

UUID=6c6e897f-625e-4bd0-9e52-b6fcce301f61 swap swap sw 0 0

and now you can reboot or simply tipe sudo mount -a

and the partition will be mounted every time.

hoping to be useful to someone, if someone told me those thing months ago that would surely had made a big change for me.

next week it’s going to arrive the gtx970 and i really hope this swap thing will work either on GPU rendering, it would simply mean you could render any complex scene on the gpu no care of the ram.
So if someone have any idea on if it goes also on gpu and eventually how to enable it, please write it down, found anything on the internet.
Your scene has to fit into the memory of your graphics card irrespective of how much system RAM you have.

Are you sure? Do you not notice the system much slower? SSD should be the trick then.
If you have a common 7200rpm hard disk, if the system starts using swap intensively then a bottleneck is created and the system slows down so much almost to freezing, you can’t do anything (even you can not go to a tty to kill Blender) and maybe you need force reboot.

I’ve been toying around with render settings, And yes. Your scene needs to fit in your gpu for it to render in the gpu.
I’ve converted a server to a workstation and I will tell you that the freedom of knowing i have 100 plus gig of ram to use is something that is very liberating As cpu rendering although not as fast is still always an option.

From what toying around I have been doing it seems it is texture maps and poly/particle count will be your huge issues of concern (and anyone elses feedback is welcome on this please) But that still leaves huge area’s of wiggle room, But who knows when cuda technology is more mature some of those issues may have more workarounds.

Glad to had been helpfull to Someone, to me it look li ke the Only slowdown it is in the beginning White calculating particles. In that phase you may see sometimes the interface to freeze for a few seconds meanwhile it is transferring the datas from ram to swap. It depend on the scene. to me For a 20 gb ram wheight scene it was like four minutes. Then when it start doing the tiles everything works quite well. Could start firefox (with like a hundred tabs) and even watch videos!

@ yafu. Yes i made a try allocating swap on 7200rpm. E17 froze. Couldnt acceed to tty and had to brute reboot. Aniway consider buying one ssd. They doesn’t cost so much as you actually don’t need a big one. Just for the /root the /home the swap and the blender folder. It really changes completely your computer performances. Debian boots up in like 7 seconds! I suppose it should charge also textures faster.

'@ joseph i found this article:https://www.google.it/url?sa=t&source=web&rct=j&ei=xPNzVZOYFsXW7QaPhYPACw&url=http://devblogs.nvidia.com/parallelforall/unified-memory-in-cuda-6/&ved=0CCsQFjAE&usg=AFQjCNE0f8z0iIpoDJVXJggF0mEBsS0jqA&sig2=wE4eLQckI3VROeXHBti_2A
i am not sure on what it is actually saying �� but it looks like you might be able to share memory between the cpu and the gpu. So maybe (you know i’m a dreaming man) it could work with the swap either. But maybe somene more competent could tell me that i had completely misunderstood that article.

Blender’s cycles gpu, and cuda tech in general is still a young technology. I have no doubt that a few years from now that it will advance by leaps and bounds. And yes right now it is at a point where money can buy some not so very flexible solutions, I think that in about 2 years that write up will be becoming the standard.