Minimum RAM requirements for madmax to create K34 plots -- and other stuff

I was using MX Linux.

My temp space has 1.8 TB available.

Success!

Via MX Linux, I used madmax’s “-r” option, set with a value of “2” (two threads, instead of the default “4”), and my K34 plot completed in (a record setting) 776 minutes.

If my understanding is correct… more threads consume more RAM, and I believe that my first two attempts failed due to exhausting the RAM. That is just a guess. But regardless of whether it was or was not RAM related, the OS should not hang (both hangs took place during phase 3).

I will now be trying, again, with “-r 3”

Congrats :champagne:

Close to 13 hrs of plotting for the laptop and just a tiny bit of stubbornness from it’s owner :stuck_out_tongue_winking_eye:

2 Likes

nice,
never give up! :slight_smile:

1 Like

My previous K34 plot took 776 minutes with madmax’s “-r 2” (two threads) option.
I just used “-r 3”, and it took 725 minutes.

madmax claims that the default value for -r is “4”.
Twice I did not set the -r value, and twice the OS hung during phase 3 (presumably due to exhausting my 20 GB of RAM).

I am trying again, but this time specifying “-r 4” to see what happens.

When RAM is exhausted, swap is being used. If swap is exhausted, any/most OSes crash. So, you may want to check how big is your swap (free), and if needed just add a swap file somewhere (performance will be horrible, though). Although, my take is that your crashes were rather thermal related, or due to corrupted partitions you initially had.

8 GB.
I did not set it. MX Linux’s installation defaulted to 8 GB.

I do not know if it is hardware or if it is software – but – one of them would throttle down the CPU frequency if heat was an issue. Also consider that two K34 plots completed.

My laptop has 4 USB ports:
Type-A x3.
Type-C x1.

Of the 3 Type-A ports, only one of them is version 3.X (not sure which specific version it is). The other two Type-A ports are 2.0.

The Type-C port is 3.X

All of my cables are Type-A. So my boot M.2 drive (encased in a USB card reader) is plugged into a 2.0 port, as is my spinning disk / final plot destination USB drive.

My T5, used for temp plotting, is in my 3.X port.

So, it is possible that if/when I ran out of RAM, the swap was taking an eternity via the 2.0 port.
But on one of the hangs, the desktop’s clock was not updating. So that indicates a genuine OS hang.

On the other hang, the screen was blank and would not wake up. So no way to see the clock.

If I can figure out how to specify a location for the swap partition, then I will consider pointing it to my T5.

On my next re-boot, I will see if I can boot my M.2 drive while connecting it to a USB hub. That will allow me to have both my OS drive and my plotting drive on the 3.X port.

The corrupted partition was an NTFS partition on my T5 drive, which played no role in my plotting (the ext4 partition on m NTFS drive did the plotting).

Also, the corrupted NTFS partition occurred when I initially used it for plotting, and the laptop hung. That hang corrupted it (not the other way around). When it was corrupted, MX Linux refused to mount it. So it played no role in the scheme of things. And MX Linux (or perhaps Linux in general) used a fair amount of CPU cycles dealing with that NTFS partition.

My final destination drive is still NTFS, because I will be using that drive on my Windows farming machine. But the bulk of avoidable CPU drain was using NTFS for plotting – not a simple file transfer.

If in doubt, you can add another 10GB or so as a swap file somewhere, and at least that thing will be off the list.

Everything inside of your laptop will heat up, and only CPU will throttle. Still CPU throttling is not really throttling the temps, but rather throttling the frequency to keep temps as high as possible (for the best performance).

If you have a key on your laptop that has LED on it (function key?), checking whether such LED will go on/off tells whether system is gone or not. Although, not too many keyboards have it now.

This is an easy guide: https://linuxize.com/post/create-a-linux-swap-file/

That /swapfile is a file in your root, so you should rather do “/mnt/hd_you_plot_to/folder/swapfile” instead, as the point is to see whether it is being used (I doubt) rather than to improve already degraded performance (if it needs to be used).

Also, you can add this new swap file as a second one, or just created a bigger one, and use only this one.

By the way, run free from time to time, that will show you swap usage.

My madmax “-r 4” K34 plot completed in 666 minutes.
So 4 threads worked. Was I just lucky, or is madmax’s claim that the default value for “-r” is “4” erroneous? Or maybe my initial two hangs had nothing to do with the “-r” value?

I could try, again, without setting the “-r” option. But I had my fill of this.

By the way, while MX Linux is copying the completed file to my NTFS formatted USB drive, “htop” is reporting that /sbin/mount.ntfs is consuming between 45% to 53% CPU usage.

That is a lot of number crunching for a (simple?) file copy. What the heck is the overhead for writing to an NTFS partition? And this is via a slow USB 2.0 connection to that NTFS drive.

And I am not sure what the “htop” percentages mean, because my laptop is a quad-core, but “htop” shows 8 CPUs. Hyper-threading? If yes, then without hyper-threading it would be ½ of the currently reported CPU percentage?

The NTFS driver uses FUSE which incurs a lot of overhead because the process is running in “user space” instead of in the kernel. The driver cannot talk to any hardware or filesystems directly and must issue system calls to the kernel for everything. The extra overhead in user space means that all reads and writes require more CPU cycles and time to handle the indirect IO.

Correct, each thread is seen as an independent CPU. So if you have a 4-core system with HT, then htop sees 8 CPU’s, each of which can go to up 100%. If all CPU cores and threads are at full utilization, then you will see 800% CPU usage. So, the ~50% usage for NTFS writes is just half of one thread’s maximum utilization. Still though, for a write, this is a lot. Using a native Linux filesystem like ext4 or xfs.

One mount option that may help when mounting the NTFS filesystem would be to set the big_writes option. You will need to mount the partition manually like so:

mount -t ntfs -o defaults,noatime,big_writes /dev/sdxX /mountpoint

The big_writes option description:

This option prevents fuse from splitting write buffers into 4K chunks, enabling big write buffers to be transferred from the application in a single step (up to some system limit, generally 128K bytes).

While that won’t bring usage down to that of a native filesystem, it may help speed up the transfer by reducing overhead.

1 Like

Nearly 1 month later, and my I5 laptop (with the help of my Samsung T5) created (38) K34 plots and (2) K33 plots, via madmax running on MX Linux.

I tested them all (chia plots check -g plot-name.plot) on my full node box, and they all came back as valid.

Hooray for me! :slight_smile:

1 Like

Congrats! Love it when perseverance overcomes obstacles. Like you I’m just getting started on K34 plots. I can’t find a great thread that talks about K34 plotting experience, so I’ll share a bit here.

Running win10, and using the chia.exe integrated madmax plotter in powershell CLI (not the gui). Chia v1.3.3.

– The HW is a i9-7940x, (14c/28t), with 32GB (4x8GB) of DDR4. Using an EVGA X299 Dark MB. Not overclocking the CPU or DDR4.
– Using 2 Optane 905P 960GB as temp drives.

– the plot string is
.\chia.exe plotters madmax -k 34 -n 32 -r 24 -t d:\ -2 b:\ -d G:\ -c… -f…

The k34 plot time is 188 minutes. I’ve made about 14 plots so far.

For k32’s, this system (using the stotiks madmax plotter) creates plots in ~32 minutes. I haven’t tried the chia integrated MM with k 32s. So K34 plotting is about 45% slower then 4 K32s.

I’d like to optimize HDD usage (prioritizing K34 plots) on my HDDs as well. I wrote a little hack program, looking for the optimal plot mixtures on various sizes of drive. I’ve only filled a 6TB drive so far with 13 K34s. None of the below has been proven.
Used plot sizes (GB not GiB) from the foxypool (dot) io plot planner:
k34=461.535GB
k33=224.227GB
k32=108.837GB

06TB, EMPTY SPACE 0 GB, k34 = 13 , k33 = 0 , k32 = 0
08TB, EMPTY SPACE 1 GB, k34 = 12 , k33 = 10 , k32 = 2
10TB, EMPTY SPACE 0 GB, k34 = 32 , k33 = 5 , k32 = 1
12TB, EMPTY SPACE 0 GB k34 = 26 , k33 = 0 , k32 = 0
14TB, EMPTY SPACE 1 GB, k34 = 25 , k33 = 10 , k32 = 2
16TB, EMPTY SPACE 0 GB, k34 = 32 , k33 = 5 , k32 = 1
18TB, EMPTY SPACE 0 GB, k34 = 39 , k33 = 0 , k32 = 0
20TB, EMPTY SPACE 1 GB, k34 = 38 , k33 = 10 , k32 = 2

4 Likes

Gotta love those 905Ps - they are fast little guys! And they certainly do the job for k34s.

1 Like

Please note that I was not getting started with K34 plots.
Rather, I was curious as to whether a nothing-special laptop could create a K34 plot.

I was not using my laptop, and so I gave it a whirl.
Once I saw that it worked, I let it toil through the process and fill my external drive with K34 plots.

My laptop can do it, which is initially what I was curious to find out. But it is not recommended as a plotting rig.

Yes I’ve lusted for the 905P for many years, but the price! Newegg was selling them for ~$530, so I bought 2 for plotting and assumed they’d hold enough value to resell in a year or 2. (More likely I’ll keep them and make it my boot drive if I’m ever done plotting.)

cool. what else are you plotting the K34s on? any key learnings you’ve had so far?

AMD Ryzen 5950X, 64 GB RAM, Samsung 2 TB 980 Pro NVMe drives.

madmax will use nearly 100% of the processor’s CPU cycles.
To make the most of the minimal remaining idle CPU time, run two plots simultaneously.

Rather than taking 3½ hours for a single K34 plot, it will take 5½ - 6 hours for two K34 plots.
So each plot takes longer, but more plots overall, per hour, are created.

I do not know if a single 2 TB NVMe drive would be able to handle two K34 plots, and I suspect that you would have bad results, time wise, hitting the same 980 Pro NVMe drive with two plots. Your 905P drives can probably handle several plots hitting it simultaneously. But 960 GB is not enough for for two K34 plots, and will be a close call for a single K34 plot (you might have to RAID 0 your two 905P drives – and hopefully you can make a hardware RAID, so that you do not consume your CPU with RAID operations).

Phases 2 and 4 use little CPU cycles. So you get the most bang for the buck when one K34 plot is in phase 1 or phase 3, while the other plot is in phase 2.

Phase 4 does not last too long.

But if you have lots of plots queued up, they will eventually end up in the same phase, or one in Phase 1 and the other in Phase 3, competing for not enough CPU cycles. But two at a time is the way to go, if you have two NVMe drives.

The Samsung 980 Pro NVMe drive is a very good choice for the temp drive.
There are faster “data center” level, U.2 drives. Although I have never used one, I believe that you would need a much faster CPU to benefit from a U.2 drive. Why?

A single Samsung 980 Pro drive pins my CPU to the ceiling for 98% of Phase 1 and most of Phase 3 (via madmax). So my CPU is the bottleneck. And my CPU is no slouch.

You would probably need a Threadripper or similar CPU to benefit from anything faster than the Samsung 980 Pro NVMe.

You already have two 905P drives. I am not familiar with them. But they are probably far faster than the Samsung 980 Pro, and will far out-live the 980 Pro. But my 980 Pro drives have far, far exceeded their TBW specification, and show no sign of performance degradation.

1 Like

Madmax fully saturates the 7940x processor. I use 24 or 26 threads. I looked at the K34 time/phase and P1 + P3 takes 93+51, 144 minutes, and the P2+P4 take 37+7, 44 minutes, so there be a lot of CPU intense overlap.

I have a 2TB 980 Pro & 2TB WD SN850, both are fast. I have a 2nd plotter(i9-7900x). I’ll set it up when I get a second HDD to fill. It’ll be faster then the laptop(LOL) but I’d guess about ~4-5 hours per k34.

Wrt CPU upgrades, a 10980xe (18c/36t) is a drop-in upgrade. It’s an older arch, but I can get it for ~$500. It’s not the best CPU, by a long shot, but bang for the buck, its a solid improvement. (The 7940x can get moved to the 2nd system).

How quickly does the ryzen 5950x/980 Pro config plot the K34s? (not completing, just curious)

A single K34 plot will run for approximately 3½ hours.
Two, simultaneous, K34 plots will run for 6 hours, each (often closer to 5¾ hours).

So creating two K34 plots, one at a time, will take a total of approximately 7 hours.
Creating two K34 plots, simultaneously, will take a total of approximately 6 hours (usually slightly less).

But the “simultaneous” option requires two temp drives.

1 Like

“10th” gen on X299 also gives you four more PCIe lanes from the CPU for another NVMe drive, assuming your motherboard has the traces and M.2 slot (or U.2 port) for it.

1 Like