I have setup a remote kernel on my Mac, which connects to a more powerful Linux 64Bit Desktop. Mathematica is setup fine on the Linux machine. CUDA is also working fine and NVIDIA_DRIVER _LIBRARY_PATH and CUDA_LIBRARY_PATH are set just fine, although they are not the default paths.

When I connect from my mac using the mathematica frontend the connection via remote kernel is initialized fine and I can do my calculations, but CUDA is not working. Taking a closer look shows, that the paths mentioned above are not set properly any more. This can be seen by checking GPUTools`Internal`\$NVIDIADriverLibraryPath and GPUTools`Internal`\$CUDALibraryPath.

On the linux machine I set the paths manually using /etc/profile file. It is my understanding that the remote kernel being setup to call the math command should just start a mathematica terminal session. Starting mathematica via terminal using the math command on the linux machine works just fine and has the paths setup correctly.

What am I missing?


1 Answer 1


I modified the /usr/local/bin/math file on the linux machine to set the NVIDIA_DRIVER_LIBRARY_PATH and the CUDA_LIBRARY_PATH, which set the paths correctly. I still don't know why setting it in /etc/profile works for the linux machine but not via remote kernel usage. If someone knows I'd like to hear why.

  • $\begingroup$ If I remember correctly then /etc/profile is for settings of interactive sessions and might not be read when just executing the script /usr/local/bin/math. You could either try /etc/bashrc or ~/.bashrc (assuming your default shell is bash). I think there might also be differences in initialization whether you explicitly call bash or whether you call justsh, so it might also depend on the shebang in /usr/local/bin/math. I suggest to check the documentation of your shell and linux distribution as I think these things might even slightly differ for various distributions and shells... $\endgroup$ Aug 28, 2013 at 13:54
  • $\begingroup$ Thanks for the answer. It's exactly what I suspected. But I was not really sure if I was missing something else. $\endgroup$
    – Wizard
    Aug 28, 2013 at 16:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.