# Matlab CUDA Mex-file

**URL:** <https://forums.developer.nvidia.com/t/matlab-cuda-mex-file/9696>\
**Category:** CUDA Programming and Performance\
**Created:** [May 25, 2009, 2:29pm UTC](https://forums.developer.nvidia.com/t/matlab-cuda-mex-file/9696 "2009-05-25T14:29:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wanderine](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@wanderine](https://forums.developer.nvidia.com/u/wanderine)\
**Post date:** [May 25, 2009, 2:29pm UTC](https://forums.developer.nvidia.com/t/matlab-cuda-mex-file/9696/1 "2009-05-25T14:29:54Z")

</div>

I’ve managed to compile my CUDA-code into a mex-file, so that I can call it from Matlab. However each time I try to call the mex-function I get the error message

Invalid mex-file, could not restore segmentation rights after relocation, permission denied

(it is translated from swedish so the original error message in english might be a bit different)

Has anyone had a similar problem?

---

<div class="post-metadata">

**Author:** ![wanderine](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@wanderine](https://forums.developer.nvidia.com/u/wanderine)\
**Post date:** [May 26, 2009, 5:59am UTC](https://forums.developer.nvidia.com/t/matlab-cuda-mex-file/9696/2 "2009-05-26T05:59:14Z")

</div>

It turned out that SELinux was preventing me from running the mex-file…
