Urgent Dwifslpreproc help

Hello community,

I am new with mrtrix3 and need urgent help.

I was using mrtrix3 on Ubuntu 18.04 and everything worked fine but now I moved my system to 22.04 to be able to use new versions of FreeSurfer and now dwifslpreproc function does not work on my new system.

What should I do? I attached the output as Images

Data = I downloaded a sample from Connectome Database which has only one phase-encoding direction (AP) (here is the link I downloaded)

Function I used = dwifslpreproc dwi_den_unr.mif dwi_preproc.mif -nocleanup -pe_dir AP -rpe_none -eddy_options " --slm=linear --data_is_shelled"



Okay, I tried to run dwifslpreproc on Ubuntu 18.04 with same function and same data but I got the same error.

Here is the log file from dwifslpreproc-tmp file:

mrconvert /mnt/c/Users/egeme/Desktop/connectomedb_sample/MGH_1010_all/mgh_1010/diff/raw/dwi_den_unr.mif /mnt/c/Users/egeme/Desktop/connectomedb_sample/MGH_1010_all/mgh_1010/diff/raw/dwifslpreproc-tmp-Q9OMYY/dwi.mif -json_export /mnt/c/Users/egeme/Desktop/connectomedb_sample/MGH_1010_all/mgh_1010/diff/raw/dwifslpreproc-tmp-Q9OMYY/dwi.json
mrinfo dwi.mif -export_grad_mrtrix grad.b
dwi2mask dwi.mif - | maskfilter - dilate - | mrconvert - eddy_mask.nii -datatype float32 -strides -1,+2,+3
mrconvert dwi.mif -import_pe_table dwi_manual_pe_scheme.txt eddy_in.nii -strides -1,+2,+3,+4 -export_grad_fsl bvecs bvals -export_pe_eddy eddy_config.txt eddy_indices.txt

I dont understand what should I do, what is the problem? Function or Data?

New update, I used dwifslpreproc function with same options on a previous DWI which i knew dwifslpreproc worked with these identical options (only phase encoding direction is PA)

Function is worked very well for this time.

What caused problem then? Does anybody have any idea?

Hi @egemen4552,

Interesting, I hadn’t yet come across this warning for eddy about specifying ‘diffusion’ as the first argument… Will be interesting to know what they have in store in future!

Nonetheless, that’s only a warning, so unlikely to be the cause of the problem. The relevant error message is actually where it says ‘Killed’. In my experience, that typically means ‘out of memory’…

How much RAM do you have on your system? You can query that using free -h.

Also, try to monitor your memory usage while running the command (you can use htop in a separate terminal for that), see if you can see the memory usage climbing and reaching capacity before the command is killed. This would then explain why your command works on previous datasets: presumably they’ll be small enough to fit in your RAM, whereas your new one won’t.

Hopefully that’ll be the problem. In which case there isn’t much you can do about it other than get more RAM…

All the best,
Donald.

Currently on side terminal I am running an MRTrix function but this is output of Free-h. I will try the h-top

Info about dataset = The dataset is anormously vast, 5-6 gb per diffusion data and 4D DTI image has 522 dimension in fourth axis. May be that is the reason why it is killed.

Why cuda is failing for this specific dataset = I am using a 4060rtx laptop, why cuda is failing for this specific dataset? While I run the function on prior datasets, eddy-cuda did not fail. (can you check my third entry @jdtournier)

I dont think the size of the dataset is related with eddy-cuda is failing but that is what it seems like.

What would be your suggestion? My system is brand new

OK, then that is indeed most likely an out-of-RAM problem. You have an 8GB system (which is the bare minimum by today’s standards), and you’re trying to process a 5-6 GB dataset. The problem is that most operations will need to hold a copy of the input data and the output data in RAM, along with any additional working memory for the algorithm to operate. For such a large dataset, you will need at least 2×6GB = 12GB, and most likely considerably more to allow for additional memory requirements – not to mention any other applications potentially also running on the system.

Note this has nothing to do with CUDA – both the CPU and CUDA versions fail in the same way, presumably because both need to allocate storage for the input and output data. I expect eddy_cuda won’t even have started any actual CUDA processing by the time it gets killed.

In general, we would recommend at least 32GB if you’re going to be running serious analyses – and given the size of that dataset, this is definitely a serious analysis! And some of the analyses you can do in MRtrix may potentially require quite a bit more than that, depending on your data (e.g. SIFT, FBA). For such a huge dataset, I would recommend upgrading to at least 64GB…

Cheers,
Donald.

Okay thanks for help, I did not know low RAM would block eddy-CUDA too

But my questions is, I am using a 32 GB RAM system. Why Ubuntu does not see it? And it doesnt make sense eddy-CUDA is killed by low RAM.

It is so weird.

Kind Regards

You wouldn’t happen to be running Ubuntu on Windows via WSL2, by any chance…?

Yes I am…

Being medical student and trying to understand technological stuff = Being thrown into ocean.

So should I convert whole system into Linux?

Well, I’m still learning too… I knew WSL2 didn’t give you access to the full system RAM, since it’s essentially a virtual machine. But I didn’t know it only gave you access to 8GB on a 32GB system…

However, it looks like this can be configured. A quick search provides a few posts on the topic, e.g. this one. It may be worth you trying to tweak these settings before doing anything too drastic!

Thanks, I’ll check it out man. You are the best