ggerganov / whisper.cpp

Port of OpenAI's Whisper model in C/C++
MIT License
36.03k stars 3.68k forks source link

CUDA installed and working, but getting error: nvcc: No such file or directory #880

Open mirozahorak opened 1 year ago

mirozahorak commented 1 year ago

Thanks to all involved for great progress in all areas! This project is helping us tremendously.

I am testing new GPU support on LINUX Ubuntu machine with 4090 installed and CUDA running without problem. However, on WHISPER_CUBLAS=1 make -j i get error below. Any ideas?

remote@ml:~/AI/TRANSCRIPTION/whisper.cpp$ nvidia-smi 
Fri May  5 17:28:18 2023       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 530.41.03              Driver Version: 530.41.03    CUDA Version: 12.1     |
|-----------------------------------------+----------------------+----------------------+
| 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  NVIDIA GeForce RTX 4090         Off| 00000000:01:00.0 Off |                  Off |
|  0%   34C    P8               15W / 450W|  14469MiB / 24564MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+

+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A      2311      G   /usr/lib/xorg/Xorg                          252MiB |
|    0   N/A  N/A      2407    C+G   ...libexec/gnome-remote-desktop-daemon      390MiB |
|    0   N/A  N/A      2445      G   /usr/bin/gnome-shell                         18MiB |
|    0   N/A  N/A      5424      G   ...ures=TFLiteLanguageDetectionEnabled       69MiB |
|    0   N/A  N/A     72513      G   /usr/lib/xorg/Xorg                           26MiB |
|    0   N/A  N/A    146863      G   ...sion,SpareRendererForSitePerProcess       61MiB |
|    0   N/A  N/A    147217      C   /home/miro/anaconda3/bin/python           13638MiB |
|    0   N/A  N/A    165127      G   gnome-control-center                          6MiB |
+---------------------------------------------------------------------------------------+
**remote@ml:~/AI/TRANSCRIPTION/whisper.cpp$ WHISPER_CUBLAS=1 make -j**
I whisper.cpp build info: 
I UNAME_S:  Linux
I UNAME_P:  x86_64
I UNAME_M:  x86_64
I CFLAGS:   -I.              -O3 -DNDEBUG -std=c11   -fPIC -pthread -mavx2 -mfma -mf16c -mavx -msse3 -DGGML_USE_CUBLAS -I/usr/local/cuda/include -I/opt/cuda/include -I/targets/x86_64-linux/include
I CXXFLAGS: -I. -I./examples -O3 -DNDEBUG -std=c++11 -fPIC -pthread -DGGML_USE_CUBLAS -I/usr/local/cuda/include -I/opt/cuda/include -I/targets/x86_64-linux/include
I LDFLAGS:  -lcublas -lculibos -lcudart -lcublasLt -lpthread -ldl -lrt -L/usr/local/cuda/lib64 -L/opt/cuda/lib64 -L/targets/x86_64-linux/lib
I CC:       cc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
I CXX:      g++ (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0

nvcc --forward-unknown-to-host-compiler -arch=native -I. -I./examples -O3 -DNDEBUG -std=c++11 -fPIC -pthread -DGGML_USE_CUBLAS -I/usr/local/cuda/include -I/opt/cuda/include -I/targets/x86_64-linux/include -Wno-pedantic -c ggml-cuda.cu -o ggml-cuda.o
make: nvcc: No such file or directory
make: *** [Makefile:171: ggml-cuda.o] Error 127
mirozahorak commented 1 year ago

Posting this as a solution that worked for me: I added to .bashrc:

export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
chriskyndrid commented 1 year ago

Although this is a rust binding variant of this error, if you're using the whisper-rs crate and you enable the cuda feature you MAY need to:

export CUDACXX=/usr/local/cuda-12.0/bin/nvcc

kornpow commented 1 year ago

Might help somebody, but to get the nvcc command I had to run: sudo apt install nvidia-cuda-toolkit

iz-ben commented 8 months ago

Posting this as a solution that worked for me: I added to .bashrc:

export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

thank you @mirozahorak

thendralmagudapathi commented 4 months ago

Might help somebody, but to get the nvcc command I had to run: sudo apt install nvidia-cuda-toolkit

HELPED ME!!