Let other applications use Matlab's version of the CUDA toolkit

8 次查看(过去 30 天)
I have an external piece of CUDA code that needs to know the path to the CUDA Toolkit in order to compile. Rather than installing a separate version of the CUDA Toolkit, I would like to use the installation already established on my machine by the Parallel Computing Toolbox (under R2018a). Is that possible, and if so, how do I locate Matlab's copy of the CUDA toolkit?
  3 个评论
Matt J
Matt J 2020-12-2
编辑:Matt J 2020-12-2
@Mohammad. Yes, I know that. Do you know the answer to my question?
Michal
Michal 2020-12-8
I have very similar problem, see here. So far, I only found several unofficial tutorials how to install supported CUDA Toolkit 10.2 on Ubuntu Linux 20.04 (officially supported linux distribution!!!) but without any success. In one case the installation of proper version of GCC broke my whole linux OS functionality??!! The main problem is the GCC compiler version compatibility. CUDA toolkit 10.2 requires GCC 7, but Ubuntu 20.04 has as default GCC 9.
From my point of view is the whole problem very hard to solve to get full CUDA functionality on latest MATLAB versions in general.

请先登录,再进行评论。

采纳的回答

Jason Ross
Jason Ross 2020-12-4
There's a difference between the whole toolkit installation and redistributable libraries. If you are compiling things you likely need access to the nvcc compiler and other things like that -- which aren't shipped or installed with MATLAB. On the GPU support by release page, this is called out where it talks about compiling applications. Note that for basic GPU gpuArray type funtions to work, your only need the driver installed -- the SDK is not required. There's more detail in this section:
CUDA Toolkit
If you want to use CUDA kernel objects or use GPU Coder, you must install a CUDA Toolkit. The CUDA Toolkit contains CUDA libraries and tools for compilation.
  10 个评论
Matt J
Matt J 2024-9-10
编辑:Matt J 2024-9-10
Thanks, but based on what you say, do you think if I do have CUDA Toolkit separately installed, that I should uninstall it? mexcuda is failing for me in R2023b on a laptop with CUDA Toolkit 10.1 installed. I think the PCT in R2023b uses Toolkit 11.8.
Joss Knight
Joss Knight 2024-9-10

mexcuda won't even be using your installed toolkit. If it fails it's probably some other reason. What is the -v output from mexcuda?

请先登录,再进行评论。

更多回答(1 个)

Bjorn Gustavsson
Bjorn Gustavsson 2020-12-2
0: I have no idea about legalities.
1, I found a lot with unix find:
$ find ./ -iname \*cuda\*.so\*
./R2020a/bin/glnxa64/libopencv_cudalegacy.so.3.4
./R2020a/bin/glnxa64/libopencv_cudabgsegm.so.3.4.0
./R2020a/bin/glnxa64/libopencv_cudaobjdetect.so.3.4
./R2020a/bin/glnxa64/libicudata.so.64.2
./R2020a/bin/glnxa64/libopencv_cudafeatures2d.so.3.4.0
./R2020a/bin/glnxa64/libopencv_cudaoptflow.so.3.4.0
./R2020a/bin/glnxa64/libopencv_cudaarithm.so.3.4.0
./R2020a/bin/glnxa64/libopencv_cudafilters.so.3.4
./R2020a/bin/glnxa64/libcudart.so.10.1
./R2020a/bin/glnxa64/libopencv_cudalegacy.so.3.4.0
./R2020a/bin/glnxa64/libopencv_cudaimgproc.so.3.4.0
./R2020a/bin/glnxa64/libopencv_cudaarithm.so.3.4
./R2020a/bin/glnxa64/libopencv_cudabgsegm.so.3.4
./R2020a/bin/glnxa64/libopencv_cudaobjdetect.so.3.4.0
./R2020a/bin/glnxa64/libopencv_cudawarping.so.3.4.0
./R2020a/bin/glnxa64/libopencv_cudawarping.so.3.4
./R2020a/bin/glnxa64/libicudata.so.64
./R2020a/bin/glnxa64/libopencv_cudafeatures2d.so.3.4
./R2020a/bin/glnxa64/libopencv_cudafilters.so.3.4.0
./R2020a/bin/glnxa64/libopencv_cudastereo.so.3.4
./R2020a/bin/glnxa64/libcudart.so.10.1.105
./R2020a/bin/glnxa64/libopencv_cudaoptflow.so.3.4
./R2020a/bin/glnxa64/libopencv_cudastereo.so.3.4.0
./R2020a/bin/glnxa64/libopencv_cudaimgproc.so.3.4
./R2013a/bin/glnxa64/libicudata.so.49
./R2013a/bin/glnxa64/libicudata.so.49.1.2
./R2013a/bin/glnxa64/libcudart.so.5.0.35
./R2013a/bin/glnxa64/libcudart.so.5.0
$ find ./ -iname \*cuda\*.a\*
./R2020a/bin/glnxa64/libcudadevrt.a
./R2020a/bin/glnxa64/libmwgpucoder_cuda.a
./R2020a/sys/cuda/glnxa64/cuda/lib64/libcudart_static.a
If you're not in a Linux/Unix OS, you should be able to find your way to similar lib-files.
HTH

类别

Help CenterFile Exchange 中查找有关 GPU Computing 的更多信息

产品


版本

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by