bladebit icon indicating copy to clipboard operation
bladebit copied to clipboard

tmpfs file system

Open juelianfy opened this issue 2 years ago • 5 comments

Can the output directory support the tmpfs file system? 1T memory is too free

juelianfy avatar Feb 15 '23 09:02 juelianfy

I don't know how involved implementing this would be now, but it would be nice to be able to use a tmpfs mount as a destination, rather than having to use brd with a filesystem on top of it.

Jsewill avatar Feb 15 '23 19:02 Jsewill

I tested that using ramdisk virtual hard disk as the output directory can't work

juelianfy avatar Feb 16 '23 08:02 juelianfy

Under Windows, using ramdisk virtual hard disk as the output directory is not enough. Linux also reports an error when using tmpfs to mount extra memory as the final output directory

juelianfy avatar Feb 16 '23 08:02 juelianfy

This is the result of Linux using tmpfs to mount extra memory as the final output directory and reporting errors. It is normal to use gigahorse or madMAx43v3r [ERROR] Fatal Error: [ERROR] Failed to open plot file with error: 22

juelianfy avatar Feb 16 '23 08:02 juelianfy

Because tmpfs does't support direct-io, using xfs:

# The unit of this parameter rd_size is k
# create a RAM disk with a capacity of 240G in /dev/ram0
sudo modprobe brd rd_nr=1 rd_size=251658240
# Make a partition use fdisk on /dev/ram0
    1. Start fdisk with the command:
    sudo fdisk /dev/ram0
    2. Type 'p' to print the partition table. This will show you the current partitions on the disk.
    3. Type 'n' to create a new partition.
    4. Follow the prompts to create the partition.
    5. Type 'p' to print the partition table.
    6. Type 'w' to write the changes to the disk.
    7. Type 'q' to exit
# make a xfs filesystem
sudo mkfs.xfs /dev/ram0p1
# mount
sudo mount -t xfs -o rw /dev/ram0p1 /tmp/ramdisk
# grant permission
sudo chmod -R 777 /tmp/ramdisk
# list /tmp/ramdisk
df -h

# go to the bladebit directory
cd /path/bladebit/build-release
# io test
./bladebit_cuda iotest /tmp/ramdisk
# plotting
./bladebit_cuda -w -n 2 -f XXX -c xchxxx --compress 0 cudaplot /tmp/ramdisk

# umount
sudo umount /tmp/ramdisk
# remove /dev/ram0
sudo rmmod brd

Evi5 avatar Apr 14 '23 11:04 Evi5