Hello, thanks to your team for providing such a wonderful tool. But now I have a problem.
When I run my application code in the Terminal,I get some error messages: No such file or directory: '/usr/local/cuda/bin/nvcc'
Traceback (most recent call last):
File "setup.py", line 44, in get_cuda_version
version_str = subprocess.check_output(
File "/opt/conda/lib/python3.8/subprocess.py", line 415, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/opt/conda/lib/python3.8/subprocess.py", line 493, in run
with Popen(*popenargs, **kwargs) as process:
File "/opt/conda/lib/python3.8/subprocess.py", line 858, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/opt/conda/lib/python3.8/subprocess.py", line 1706, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/cuda/bin/nvcc'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "setup.py", line 102, in <module>
CUDA, CUDA_VERSION = locate_cuda()
File "setup.py", line 83, in locate_cuda
version = get_cuda_version(cuda_home)
File "setup.py", line 51, in get_cuda_version
raise RuntimeError("Cannot read cuda version file")
RuntimeError: Cannot read cuda version file
I test if nvcc exists:
(base) jovyan@8382018aecb5:~$ nvcc -V
bash: nvcc: command not found
After that, I tried to add environment variables when creating the image:
FROM cschranz/gpu-jupyter:v1.4_cuda-11.0_ubuntu-20.04_python-only
ENV GRANT_SUDO yes
ENV JUPYTER_ENABLE_LAB yes
ENV PATH $PATH:/usr/local/cuda/bin
ENV CUDA_HOME /usr/local/cuda
ENV LD_LIBRARY_PATH /usr/local/cuda/lib64:$LD_LIBRARY_PATH
RUN python3 -m pip install opencv-contrib-python
And, use conda to install 'cudatoolkit', But it still didn't work:
(base) jovyan@8382018aecb5:~$ env | grep CUDA
NVIDIA_REQUIRE_CUDA=cuda>=11.0 brand=tesla,driver>=418,driver<419 brand=tesla,driver>=440,driver<441 brand=tesla,driver>=450,driver<451
CUDA_VERSION=11.0.3
CUDA_HOME=/usr/local/cuda
(base) jovyan@8382018aecb5:~$ nvcc -V
bash: nvcc: command not found
How should I solve this problem?
By the way, It's no problem to test cuda:
Thu Jul 1 03:03:31 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.84 Driver Version: 460.84 CUDA Version: 11.2 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 Quadro P1000 Off | 00000000:01:00.0 On | N/A |
| 34% 34C P8 N/A / N/A | 757MiB / 4038MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
+-----------------------------------------------------------------------------+
import torch
torch.cuda.is_available()
# True
# after run "conda install cudatoolkit -y"
from numba import cuda
cuda.is_available()
# True