# CUDA Trouble, MMA12 Quadro RTX 4000

Started this unfortunately as an answer in this question on GPUs under Mma12: previous GPU question, while it should have gone into a new question. I will try to answer questions already posted on the other thread here (or directly in this new description)

After today's upgrade to MMA12 I am running into a CUDA issue with my Quadro RTX 4000. (@CA Trevillian: The Quadro RTX4000 is the entry level Quadro card, not a mobile. It is the equivalent of a 2070.)

• OS is Win 8.1 x64 latest patch level.
• Latest NVidia driver version "431.02-quadro-desktop-notebook-win8-win7-64bit-international-whql". @Trevillian: 431.02 is also what the CUDADriverVersion[] reflects.
• Latest CUDA install, "cuda_10.1.168_425.25_windows". Installation will not overwrite newer display drivers even if it is configured to install during installation (states drivers for display and audio are newer and leaves them).
• CUDA samples from the CUDA install, e.g., under extras/demo_suite are running fine (no errors).
• Paclet installs:
• CUDAQ[] triggering install? I thought it should only return True/False, so False if paclet is not installed?
• paclet installs from the network are slow (half hour, not my internet connection, has anyone also noticed the paclet server being slow?)
• paclet reinstall with Update-True is not too smooth. It complains that after the CUDAQ[] install it cannot deinstall completely and the state of the install is not always obvious
• install from local paclet file works. I tried a few variations to test if there would be differences, e.g., PacletInstall and CUDAResourcesInstall with or without the Update Flag. All appear to be the same.
• The CudaResourcesInstall or paclet install with a RebuildPacletData[] results in Paclet[CUDAResources,12.0.359,<>] . So things are looking fine.
• However a CUDAResourcesInformation[] then goes haywire:
• StringToStream: String expected at position 1 in StringToStream[ImportExportHashDumpexpr].
• BinaryReadList: \\$Failed is not a string, SocketObject, InputStream[ ], or OutputStream[ ].
• Java: Method named update defined in class java.security. MessageDigest$$Delegate was called with an incorrect number or type of arguments. The arguments, shown here in a list, were {BinaryReadList[$$Failed,Byte,131072],0,3}.
• etc., about 9 lines total, until "Further output of Java::argx will be suppressed during this calculation"
• Then hangs until manually aborted.
• CUDA with 9.x under Mma 11.3 did not hang, but as it did not know the card, it had some form of generic resource listed as in CUDAResourcesInformation[] resulting in: {{Name->CUDAResources,Version->11.3.82,BuildNumber->,Qualifier->Win64,WolframVersion->11.2,11.3,SystemID->{Windows-x86-64},Description->{ToolkitVersion -> v9.1, MinimumDriver -> 290},etc.

@Kuba: thanks for the heads up. Indeed, this also went to WRI support. However I posted this here once more, as there might be other persons with the Quadro RTX4000 card or encountering issues with Mma12 and CUDA as the other post suggested. I cannot enter the new tags for quadro or RTX4000 yet. Hopefully the post is now correct.

The error messages sound as if some jumbled arguments might be fed to a java routine, maybe the Quadro card is not properly recognized, resulting in an empty string entering the "gears" of the CUDALink software?

Certainly would be curious if someone would have any ideas. There are a few CUDA/MMa projects waiting. Thanks in advance.

• Obligatory: support.wolfram.com/kb/41293, although I fear it may not be that useful here. In any event, they seem to recommend you reach out for their assistance in troubleshooting.
– ktm
Jul 31, 2019 at 12:48
• Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! Jul 31, 2019 at 15:13
• Don't send it to me, send it to Wolfram Support :)
– ktm
Aug 1, 2019 at 14:04
• @user6014: According to the kb41293 page: The card has a 7.5 CUDA rating. 2. The NVIDIA driver is up-to-date and CUDA works (at least the demos). The test notebook went to WRI support, including: Needs["CUDALink] (<< CUDALink) CUDAQ[] (with comments) CUDADriverVersion[] (with comments as the Quadro driver was a newer build than the CUDA driver, which could cause issues) CUDAResourcesInstall[] (working!) CUDAResourcesInformation[] (Crashing) CUDAInformation[] (actually works) SystemInformation[] (not posted here). This could be a generic issue with all cards using quadro drivers. Aug 1, 2019 at 14:07
• a) Don't use the CUDA package, it doesn't work (tested on Win and Linux). Instead, write your own CUDA code and use it with LibraryLink. It works like a charm. There is an example in the documentation that shows how to do that. LibraryLink incures zero latency, and now you get the CUDA speed directly from the M kernel. LL doesn't care or even know, that you implement something in CUDA. b) the 431 driver is VERY old. c) I don't think the hardware, RTX 4000, makes a difference. And if you do what I say in a) for sure it won't. Mar 8, 2021 at 2:55

Answer: CUDA does not load correctly under mma12.0 in my case (Win 8.1/x64, installation on D drive, no other obvious issues). Workaround: In addition to Needs["CUDALink"], as a manual load of libeay32.dll, e.g., LibraryLoad["\SystemFiles\Libraries\Windows-\ x86-64\libeay32.dll"] then things proceed as intended.

The cause appears to be buried in how the paths were written in OpenSSLLink64.dll for mma12.0. Hashes and checksums of my installation match Wolframs'. Other checks together with Wolfram support also bore out. Even substituting the 11.3 version of the OpenSSLLink64.dll in place for the 12.0 version worked loading the missing library. It failed using the vanilla installation only loading CUDALink.

It could be that things work with the default installation. In my case with Mma installed on a D drive, it did not work for 12.0 but worked on 11.3. If I had to guess, it could be e.g., a missing quote, then paths working under Linux or MacOS but not with Windows formats, including spaces etc. A full solution is out of reach for the user, except with the workaround provided.

CUDA package works for me. UBUNTU 20.04, WL/MMA 12.03.0.0, NVIDIA GTX 1650, NVidia Driver 470.86, CUDA version 11.4

Everything works just fine, as long as (for some reason) you do not run CUDAResourcesInformation[ ]. If I run it, I've to restart my pc, to get CUDA package works again.

• What is version 12.03? Did you mean 12.3.0`? Dec 13, 2021 at 1:40