Message Boards Message Boards

0
|
11887 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Avoid errors with CUDAFunctionLoad in Mathematica 11.1.0.0?

Posted 7 years ago

Before with Mathematica 11.0.1.0 my CUDA was working fine. Now with Mathematica 11.1.0.0, CUDAFunctionLoad gives errors. Take this simple example from Mathematica documentation:

Needs["CUDALink`"]
code = "
  __global__ void addTwo(mint * in, mint * out, mint length) {
    int index = threadIdx.x + blockIdx.x*blockDim.x;
    if (index < length)
     out[index] = in[index] + 2;
  }";
cudaFun = 
 CUDAFunctionLoad[code, 
  "addTwo", {{_Integer, _, "Input"}, {_Integer, _, 
    "Output"}, _Integer}, 256]

This is gives issues with StringJoin, StringTrim and an internal error

CCompilerDriver`CCompilerDriverBase`InvokeCompiler::cmdstr: An internal error occurred while generating compilation commands. The InputForm of the generated command list is StringTrim[StringJoin["\n\n", CCompilerDriver`CCompilerDriverBase`BaseDriver["CreateExecutableCommands"][CUDAFunctionLoad, <<20>>, {"CreateBinary" -> True, "CUDAArchitecture" -> {}, "Defines" -> {"USING_CUDA_FUNCTION" -> 1, <<2>>, "USING_DOUBLE_PRECISIONQ" -> 1}, <<17>>, "XCompilerInstallation" -> Automatic}], "\n"]]

CUDAFunctionLoad::cmpf: The kernel compilation failed. Consider setting the option "ShellOutputFunction"->Print to display the compiler error message.

This is with CUDA paclet 10.5.0 still based on the old CUDA 7.5.18 toolkit in stead of CUDA 8.0. Compiler is from Microsoft Visual Studio 2015 Community Edition. OS is Windows 10. nVIDIA driver is latest 378.78 with CUDA 8.0 in the driver.

Update 27/03/2017:

In the meantime I also have Mathematica 11.1.0.0 running in CentOS 7.3 x86_64 linux with gcc 4.8 as compiler and latest nVIDIA driver 375.39. I can confirm the same string errors happen. It seems internal Mathematica processing that goes wrong.

POSTED BY: Bert Aerts
3 Replies
Posted 7 years ago
POSTED BY: Bert Aerts
Posted 7 years ago

With the yesterday released Mathematica 11.1.1 CUDAFunctionLoad works again. I tested it on CentOS 7.3 64 bit Linux with gcc 4.8.

But still the CUDA paclet is version 10.5.0 based on CUDA Toolkit 7.5. In Windows 10 Microsoft Visual Studio 2013 is needed to use CUDAFunctionLoad. I hope that Wolfram soon releases a new paclet based on CUDA Toolkit 8.0. Then Microsoft Visual Studio 2015 update 3 can be used.

POSTED BY: Bert Aerts
Posted 7 years ago
POSTED BY: Robert Rimmer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract