Matlab CUDA Mex-file

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?

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