CUDAlink does not support nVIDIA CUDA Toolkit

Hi,
Currently both Mathematica 13.1 and 13.2 only support CUDA Toolkit 11.8 from nVIDIA.
When will CUDAlink support CUDA Toolkit 12.0 from nVIDIA?

Kind regards,
Bert

Are you sure it is not a fake limitation, cause major version changed?

I contacted Wolfram support and got as answer:

Our developers tell me that they are currently working on this and support could be added in 13.2.1.

Meanwhile installed 11.8. CUDA works now, but OpenCL does not :frowning: I was also surprised it apparently needs CUDA now…

Looks like 13.2 broke OpenCL.

On my laptop running Ubuntu 22.10 both CUDA 11.8 and OpenCL 3.0 are working fine. I start Mathematica 13.2 with this shell script:

cat mathematica.sh 
export NVIDIA_DRIVER_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/libnvidia-tls.so.525.60.11
export CUDA_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/libcuda.so
export PATH=/home/bert/bin_gcc_11:/usr/local/cuda-11.8/bin:$PATH$
g++ --version
mathematica &

Then OpenCL looks like:

Yeah, on windows 11 OpenCLQ[] fails already, so does info command.

There is also an issue that even though Visual Studio 2022 is used by Mathematica to compile CUDA, and it works great, CUDACCompilers[]

still prints (but that is old issue)

{{“Name” → “Visual Studio”,
“Compiler” →
CCompilerDriverVisualStudioCompilerVisualStudioCompiler,
“CompilerInstallation” →
“C:\Program Files (x86)\Microsoft Visual
Studio\2019\Enterprise”, “CompilerName” → Automatic}}

Unfortunately Mathematica 13.2.1 still doesn’t support nVIDIA CUDA Toolkit 12.0.1

Wolfram support says they are still working on it…

So do you know how to make OpenCL work on windows? It still does not work with 13.2.1 and latest Nvidia driver and Toolkit 11.8.

CUDA Toolkit 12.2 released today. Mathematica 13.3.0 released today. On Ubuntu 23.04 with
nVIDIA driver 535.54.03 on GeForce RTX 2060 laptop.

Example from Wolframs Documentation FAILS: CUDAMap.

And CUDADot seems to work without error message, but gives wrong results.

Only specifying a CUDA kernel function gives correct results

What am I doing wrong?
Can anyone confirm the same behaviour?
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshotfrom2023-06-2822-07-27.png&userId=340012
[2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshotfrom2023-06-2822-07-11.png&userId=340012
[3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshotfrom2023-06-2822-10-10.png&userId=340012
[4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshotfrom2023-06-2822-02-53.png&userId=340012
[5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshotfrom2023-06-2822-14-12.png&userId=340012

Well, on 13.3 and Toolkit 11.8 {0.540302, -0.416147, -0.989992, -0.653644, 0.283662, 0.96017,
0.753902, -0.1455, -0.91113, -0.839072} is printed.

Did not test 12.2 toolkit yet.

Very sorry about this. There should be a paclet update soon to resolve this issue on Linux (WL v13.3).
In the meantime, you could try renaming the underlying Examples library:

e.g.:

mv ~/Wolfram/Mathematica/13.3/SystemFiles/Links/GPUTools/LibraryResources/Linux-x86-64/Examples_12.so ~/Wolfram/Mathematica/13.3/SystemFiles/Links/GPUTools/LibraryResources/Linux
-x86-64/libExamples_12.so

restart WL and retry:

Needs["CUDALink`"]
CUDAQ[]
CUDAMap[Cos, 1.*Range[10]]

Also, you mention CUDADot not giving the correct result, could you please provide an example.

This behavior is reproducible and a new paclet release with the fix will release soon. For now, the workaround would be renaming following two files “Examples_12.so” and “Examples_11.so” present in

FileNameJoin[{$InstallationDirectory, "SystemFiles", "Links", "GPUTools", "LibraryResources", "Linux-x86-64"}]

to “libExample_12.so” and “libExample_11.so” respectively.

OK thanks for the fix of renaming the library files.
CUDAMap now gives correct results.

But please look at below image : CUDADot gives wrong results:

Mathematica 13.3.1 finally fully supports nVIDIA CUDA Toolkit 12.2.1
The CUDADot issue is solved.
Tested on Ubuntu 23.04 with nVIDIA 535.98 driver.

Meawhile

Get["OpenCLLink`OpenCLLink`"]

still prints and OpenCL does not work.

SetDelayed::write: Tag NVCCCompiler in NVCCCompiler[Available] is Protected.

SetDelayed::write: Tag NVCCCompiler in NVCCCompiler[Name][] is Protected.

SetDelayed::write: Tag NVCCCompiler in NVCCCompiler[Name][] is Protected.
General::stop: Further output of SetDelayed::write will be suppressed during this calculation.
Set::write: Tag NVCCCompiler in Options[NVCCCompiler] is Protected.
Set::write: Tag NVCCCompiler in Options[NVCCCompiler] is Protected.
Table::iterb: Iterator {CCompilerDriver`CCompilerDriverRegistry`Private`installation,NVCCCompiler[Installations][]} does not have appropriate bounds.
Table::iterb: Iterator {CCompilerDriver`CCompilerDriverRegistry`Private`installation,NVCCCompiler[Installations][]} does not have appropriate bounds.