Skip to content

Function not implemented errors when using RAM drive #248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
brechtsanders opened this issue Dec 23, 2021 · 12 comments
Closed

Function not implemented errors when using RAM drive #248

brechtsanders opened this issue Dec 23, 2021 · 12 comments

Comments

@brechtsanders
Copy link

brechtsanders commented Dec 23, 2021

To increase build times in Windows I use a RAM drive for my build processes.
Specifically I use ImDisk set up like this:

imdisk -a -t vm -s 32G -m R: -p "/FS:NTFS /V:RAMDisk /Q /Y" -o fix

But when using LLVM build tools on this drive I get Function not implemented errors that I don't get when working on my normal disk.

It is not just one specific application. I have seen it in llvm-rc.exe and llvm-ar.exe, but clang.exe doesn't have this problem.

Do you any idea what causes this and how to fix this?

@longnguyen2004
Copy link
Contributor

longnguyen2004 commented Dec 23, 2021

rust-lang/rust#90780 Seems like an ImDisk problem
Also https://bugs.llvm.org/show_bug.cgi?id=52080

@brechtsanders
Copy link
Author

brechtsanders commented Dec 23, 2021

Okay, good to know LLVM is already looking at this bug.

It's not the first application to run into these issues. I while back I reported similar problems in Meson: mesonbuild/meson#7295

Once you've used a RAM drive it's impossible to get used to the slow speeds of disk I/O again when building.
I hope they fix it the next release.

@longnguyen2004
Copy link
Contributor

Just so you know, this is because of ImDisk not implementing various functions that LLVM and other programs use (see the Rust issue above), so there's not much they can do about it.

@brechtsanders
Copy link
Author

Maybe that's why ImDisk it's so fast: it's light because it doesn't implement all the bells and whistles...

@mstorsjo
Copy link
Owner

I think that bug might be fixed in latest git of LLVM. I tried building a snapshot of the latest git of both LLVM and mingw-w64, available at https://martin.st/temp/llvm-mingw-dec2021-x86_64.zip. Does this fix the issue for you?

@brechtsanders
Copy link
Author

Yes, that fixed the RAM drive issues with ImDisk.

@mstorsjo
Copy link
Owner

mstorsjo commented Feb 9, 2022

FWIW, this issue is now also fixed in the latest proper (pre)release, https://github.com/mstorsjo/llvm-mingw/releases/tag/20220209.

@mstorsjo
Copy link
Owner

Now LLVM 14.0.0 final is released, and there's a fullblown, non-rc, release with the fix: https://github.com/mstorsjo/llvm-mingw/releases/tag/20220323

@MolotovCherry
Copy link

MolotovCherry commented Nov 12, 2022

Just want to say, there's a way to fix this. So apparently, imdisk doesn't have compatibility with everything. But the imdisk author has a product that does work with this.

http://www.ltr-data.se/opencode.html/#ImDisk

Compatibility
ImDisk Virtual Disk Driver is designed to be a small, simple and yet powerful virtual disk driver. It runs on very old versions of Windows NT as well as modern Windows versions. However, because of this compatibility design and because it emulates disk volumes rather than complete disks, it is not always compatible with all applications and drivers. For instance, you cannot manage things like mount points, drive letters and similar for ImDisk drives using mountvol command line tool or in Disk Management in Windows. As another example, you cannot create or access shadow copies on ImDisk drives. So, applications that use similar Windows features as Disk Management dialog to enumerate disks and disk volumes to find disk properties like sector sizes and similar, might possibly not work as expected with ImDisk drives.

Arsenal Image Mounter - If you need full disk emulation support
If you need full disk emulation, including integration with Disk Management, Volume Shadow Copy Services, mountvol and diskpart command line tools as well as better compatibility with applications, we provide another open source virtual disk project, called Arsenal Image Mounter. It is published together with Arsenal Recon and is available for download here. It is available for non-commercial use under AGPL license. Commercial license options available, please contact Arsenal Recon for more information. Source code, command line tools, driver setup packages and similar for Arsenal Image Mounter are available on GitHub. The directory structure is desribed in this document.

Download and install the driver for arsenal image mounter, then go to this page and download aim_ll.zip, then you can create a volume (as a startup script even) like so

%~dp0\aim_ll -a -t vm -s 3G -p "/fs:ntfs /v:RamDisk /q /y" -o rw,fix,hd -m R:

See the cmdline details for more info, but with -s you can set the size, format as ntfs, make it a hd, etc

@brechtsanders
Copy link
Author

Thanks for the tip, but I'm still using ImDisk without issues thanks to the fix.
Arsenal-Image-Mounter is a commercial application, I want to stick to a free solution.

@MolotovCherry
Copy link

MolotovCherry commented Nov 13, 2022

Thanks for the tip, but I'm still using ImDisk without issues thanks to the fix. Arsenal-Image-Mounter is a commercial application, I want to stick to a free solution.

It's actually open source under the AGPL license! But yeah, you can use what you want. My comments purpose is to be there for anyone who finds it useful. Glad the issue's fixed for you!
https://github.com/ArsenalRecon/Arsenal-Image-Mounter

@bitraid
Copy link

bitraid commented Nov 13, 2022

You can also try memfs from WinFSP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants