Until now, I had no problem with working with codes that deal with CUDA. I use pytorch
a lot, and my codes all run great. When I type in
> nvidia-smi
, I get
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.100 Driver Version: 440.100 CUDA Version: 10.2 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce RTX 208... Off | 00000000:01:00.0 On | N/A |
| 0% 49C P8 17W / 300W | 744MiB / 11016MiB | 13% Default |
+-------------------------------+----------------------+----------------------+
| 1 GeForce RTX 208... Off | 00000000:02:00.0 Off | N/A |
| 0% 42C P8 8W / 300W | 12MiB / 11019MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1173 G /usr/lib/xorg/Xorg 223MiB |
| 0 1404 G /usr/bin/gnome-shell 135MiB |
| 0 2459 G ...AAAAAAAAAAAACAAAAAAAAAA= --shared-files 70MiB |
| 0 4744 C+G .../local/MATLAB/R2019a/bin/glnxa64/MATLAB 309MiB |
+-----------------------------------------------------------------------------+
which, as far as I know means that I'm using CUDA version 10.2 along with graphics driver version of 440.100. Default location of CUDA install should be
/usr/local/cuda*
but my /usr/local
does not show any version of CUDA. I tried to search for the solution of finding the location, and tried to do what others suggest as in [https://stackoverflow.com/questions/36279045/where-did-cuda-get-installed-in-my-computer], and it seems the only viable location among the lists is
/usr/lib/cuda
Is this the right directory? I am suspicious because I get
> nvcc - V
Command 'nvcc' not found, but can be installed with:
sudo apt install nvidia-cuda-toolkit
I'm confused because I really cannot find where CUDA is installed, while my pytorch
codes are all working fine.
The reason why I'm trying to figure out where my CUDA is located is because I have to set up an environment in MATLAB
so that I can compile a CUDA code, and when I try to compile, it throws an error saying
>> mexcuda foo.cu
Warning: Version 10.0 of the CUDA toolkit could not be found. If installed, set MW_NVCC_PATH environment variable to location of
nvcc compiler.
> In mexcuda (line 166)
Error using mex
No supported compiler was found. For options, visit https://www.mathworks.com/support/compilers.
Error in mexcuda (line 166)
[varargout{1:nargout}] = mex(mexArguments{:});
Could anybody help me with my confusion?