Hey Everyone,
I'm working on a fresh install of an Ubuntu 18.04 system. Everything was going well until I got MATLAB 2019a and was trying to compile GPU code.
Namely, when running
mexcuda mexGPUExample.cu
In MATLAB, it will tell me:
Warning: Version 10.0 of the CUDA toolkit could not be found. If installed, set MW_NVCC_PATH environment variableto location of nvcc compiler. > In mexcuda (line 166) Error using mexNo supported compiler was found. For options, visit https://www.mathworks.com/support/compilers.Error in mexcuda (line 166) [varargout{1:nargout}] = mex(mexArguments{:});
So I found my CUDA 10.1 installation at the normal symbolic link place and updated the environment:
setenv('MW_NVCC_PATH','/usr/local/cuda/bin')
Then ran mexcuda again. Still the same error message. However, oddly enough, when I run d = gpuDevice() it works perfectly and shows:
>> d = gpuDeviced = CUDADevice with properties: Name: 'GeForce GTX 1070' Index: 1 ComputeCapability: '6.1' SupportsDouble: 1 DriverVersion: 10.1000 ToolkitVersion: 10 MaxThreadsPerBlock: 1024 MaxShmemPerBlock: 49152 MaxThreadBlockSize: [1024 1024 64] MaxGridSize: [2.1475e+09 65535 65535] SIMDWidth: 32 TotalMemory: 8.5126e+09 AvailableMemory: 8.0890e+09 MultiprocessorCount: 15 ClockRateKHz: 1721000 ComputeMode: 'Default' GPUOverlapsTransfers: 1 KernelExecutionTimeout: 1 CanMapHostMemory: 1 DeviceSupported: 1 DeviceSelected: 1
If I update my path variable and run nvcc –version it shows:
$ export PATH=/usr/local/cuda-10.1/bin$ nvcc --versionnvcc: NVIDIA (R) Cuda compiler driverCopyright (c) 2005-2019 NVIDIA CorporationBuilt on Wed_Apr_24_19:10:27_PDT_2019Cuda compilation tools, release 10.1, V10.1.168
Any ideas as to why CUDA is recognized, the GPU works, but MATLAB will not let CUDA 10.1 be CUDA 10.0?
Thanks!
Best Answer