bladebit icon indicating copy to clipboard operation
bladebit copied to clipboard

Plotting to tmpfs fails on write

Open rjasonadams opened this issue 4 years ago • 7 comments

Hello,

I'd like to remove the need for nvme by using more ram.

Mounted a large tmpfs:

tmpfs   /mnt/tmpfs         tmpfs   rw,size=500G          0  0

Set <out_dir> to it and it's failing on the initial write:

Error: Failed to open plot output file at /mnt/tmpfs/plot....plot.tmp for writing after 16 tries.
Error: Plot ... failed... Trying next plot.

It does make a zero length file in the directory though. Any ideas on the cause?

rjasonadams avatar Nov 20 '21 20:11 rjasonadams

This is due to the final plot file being written unbuffered (with direct I/O enabled), which tmpfs does not support. An upcoming version will allow you to disable this by setting a command line option.

harold-b avatar Nov 20 '21 21:11 harold-b

I am also waiting for a solution to this issue. But for now I'm using this:

insmod /lib/modules/5.4.0-107-generic/kernel/drivers/block/brd.ko rd_nr=1 rd_size=115343360
fdisk /dev/ram0
mkfs.xfs /dev/ram0p1
mount /dev/ram0p1 /mnt/RAM

and use this folder as the final folder for the plots. p.s. Do not forget about the correct rights to the folder.

Paradzzz avatar Apr 08 '22 14:04 Paradzzz

I got a similar error but I just have 4 SSD's in a raid.

Yamanipanuchi avatar Sep 01 '23 23:09 Yamanipanuchi

This is due to the final plot file being written unbuffered (with direct I/O enabled), which tmpfs does not support. An upcoming version will allow you to disable this by setting a command line option.

Was this feature ever added? Trying to plot directly to 256GB ramdisk on 2.1.1 with chia plotters bladebit ramplot -d /mnt/ramdisk/ but also getting an empty .tmp file.

Plot temporary file: /mnt/ramdisk/plot-k32-c07-2023-12-08-11-35-77bab4a511f14596f28cef564cafee7c8658f37e2545899ef0d0332b662c9b0e.plot.tmp

STDERR: 

STDERR: Fatal Error:  

STDERR: Failed to open plot file with error: 22

zivester avatar Dec 08 '23 16:12 zivester

Yes you can use the --no-direct-io global option (specify it before the cudaplot command).

harold-b avatar Dec 09 '23 05:12 harold-b

Yes you can use the --no-direct-io global option (specify it before the cudaplot command).

Hmm I've tried basically all positional args and it doesn't seem recognized. Is it not available with ramplot? :thinking:

$ chia plotters bladebit --no-direct-io ramplot -d /mnt/ramdisk/ -f
chia plotters: error: unrecognized arguments: --no-direct-io

zivester avatar Dec 10 '23 13:12 zivester

It's available only directly from the bladebit executable itself, not from chia plotters

harold-b avatar Dec 13 '23 23:12 harold-b