[Mrtrix-discussion] memory-mapping failed in csdeconv

Donald Tournier d.tournier at brain.org.au
Mon Jul 2 17:54:44 PDT 2012


Hi Dan,

Glad you figured it out - I'm guessing the Windows pre-compiled version is
a 32-bit executable, so would be limited to 4GB even if more RAM were
available. Ben, maybe you can confirm? How difficult would it be to compile
a 64-bit version...?

In case you're wondering, the limit for memory mapping is actually 2GB on
32-bit executables, due to the way it's typically implemented. That's
probably why it failed for your 1.5GB file - assuming the DWI file (which
was already mapped) was itself already claiming a large chunk of your
address space.

Cheers,

Donald.


On 3 July 2012 00:56, Dan Wu <dwu18 at jhu.edu> wrote:

> Hi Donald,
>
> I have actually figured out the problem. It is the file size. I reduced
> the image size (by undersample) and it works. Still don't know why a 1.5GB
> mapping would fail on a 64bit system, but anyhow the problem is solved for
> now. Thanks for your suggestion!
>
> Regards,
>
> Dan
>
>
> On Mon, Jul 2, 2012 at 10:41 AM, Dan Wu <dwu18 at jhu.edu> wrote:
>
>> Hi Donald,
>>
>> I checked the possibilities you mentioned. The CSD file created is about
>> 1.5GB, and I have a 64bit window 7 system. I also turned on the debug
>> option to check. The raw data, gradient table, response.txt, mask.mif all
>> look okay, not empty and they mapped successfully. I have a pretty good
>> computer (16GB memory) and there's no other files open.
>>
>> Could there be another reason except file/memory related issues? I
>> attached a screenshot of the debug messages. Thanks again.
>>
>> Best,
>>
>> Dan
>>
>>
>> On Sun, Jul 1, 2012 at 9:31 PM, Donald Tournier <d.tournier at brain.org.au>wrote:
>>
>>> Hi Dan,
>>>
>>> It's a bit strange to get a 'no error' error message... I'm assuming
>>> you're running on Windows? If so, I think I know why the error message is
>>> essentially empty. But in the short therm, it'll be very difficult for you
>>> or me to fix this so it does produce a sensible error message. Your best
>>> bet is to figure it out by yourself. There aren't many reasons for a memory
>>> mapping to fail, it could be:
>>>
>>>    - file not found
>>>    - file is empty
>>>    - permission denied
>>>    - file size exceeds addressable space (2GB on a 32-bit system)
>>>    - not enough physical RAM
>>>    - too many open files
>>>    - ...
>>>
>>> Hopefully one of these will ring a bell, and you'll be able to figure
>>> out the problem...
>>>
>>> For those who are interested: this is probably a consequence of the fact
>>> that this particular operation (memory-mapping) is the only not explicitly
>>> handled by MingW (the compiler we use on Windows, which provides most of
>>> the functions normally available on a Unix (POSIX) system). Because of
>>> that, we call the relevant Windows-specific functions directly, but I
>>> hadn't realised that we also need to retrieve any eventual error messages
>>> using the Windows-specific calls too. It's trivial to modify the code to do
>>> so, but compiling the code on Windows is a black art, and so far Ben
>>> Jeurissen is the only person to have figured it out properly. I don't think
>>> it's worth releasing a new version just for this bug, but the fix is now in
>>> the code for the next release - hopefully you'll get more helpful error
>>> messages in the next version...
>>>
>>> Hope that helps.
>>> Cheers,
>>>
>>> Donald.
>>>
>>>
>>>
>>> On 2 July 2012 09:17, Dan Wu <dwu18 at jhu.edu> wrote:
>>>
>>>> Dear experts,
>>>>
>>>> I got an error message "memory-mapping failed for image ".\CSD6.mif":
>>>> No error " when I tried to do csdeconv. Does anyone know what could be the
>>>> possible reason? I realized that that the SH coefficients of my response
>>>> function is higher than usual. Could that be the reason for the failure?
>>>> Thanks!
>>>>
>>>> Regards,
>>>>
>>>> Dan
>>>>
>>>>
>>>> --
>>>> Dan Wu
>>>>
>>>> PhD Candidate
>>>> Department of Biomedical Engineering
>>>> Johns Hopkins University
>>>> email: dwu18 at jhu.edu
>>>> phone: 443-564-9191
>>>>
>>>>
>>>> _______________________________________________
>>>> Mrtrix-discussion mailing list
>>>> Mrtrix-discussion at www.nitrc.org
>>>> http://www.nitrc.org/mailman/listinfo/mrtrix-discussion
>>>>
>>>>
>>>
>>>
>>> --
>>> Jacques-Donald Tournier (PhD)
>>> Brain Research Institute, Melbourne, Australia
>>> Tel: +61 (0)3 9035 7033
>>>
>>
>>
>>
>> --
>> Dan Wu
>>
>> PhD Candidate
>> Department of Biomedical Engineering
>> Johns Hopkins University
>> email: dwu18 at jhu.edu
>> phone: 443-564-9191
>>
>>
>
>
> --
> Dan Wu
>
> PhD Candidate
> Department of Biomedical Engineering
> Johns Hopkins University
> email: dwu18 at jhu.edu
> phone: 443-564-9191
>
>


-- 
Jacques-Donald Tournier (PhD)
Brain Research Institute, Melbourne, Australia
Tel: +61 (0)3 9035 7033
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.nitrc.org/pipermail/mrtrix-discussion/attachments/20120703/71932304/attachment.html


More information about the Mrtrix-discussion mailing list