Chia-Network / bladebit

A high-performance k32-only, Chia (XCH) plotter supporting in-RAM and disk-based plotting
Apache License 2.0
337 stars 107 forks source link

Plotting to tmpfs fails on write #151

Open rjasonadams opened 2 years ago

rjasonadams commented 2 years ago

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 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?

harold-b commented 2 years ago

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.

Paradzzz commented 2 years ago

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.

Yamanipanuchi commented 1 year ago

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

zivester commented 10 months ago

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
harold-b commented 10 months ago

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

zivester commented 10 months ago

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
harold-b commented 10 months ago

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