Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TTS]Docker develop-gpu-cuda10.2-cudnn7-latest 缺失 libsndfile1-dev 和 環境參數CUDA_VISIBLE_DEVICES #3158

Open
kenny-chen opened this issue Apr 13, 2023 · 2 comments

Comments

@kenny-chen
Copy link

Describe the bug
Docker develop-gpu-cuda10.2-cudnn7-latest 缺失:

  1. apt install libsndfile1-dev
  2. 環境參數 os.environ["CUDA_VISIBLE_DEVICES"] = "0"

To Reproduce

  1. 按照官方教程,使用Docker鏡像部署 docker pull paddlecloud/paddlespeech:develop-gpu-cuda10.2-cudnn7-latest
  2. 進入Docker鏡像 nvidia-docker run --runtime=nvidia -it -v ~/PycharmProjects/PaddleSpeech:/home paddlecloud/paddlespeech:develop-gpu-cuda10.2-cudnn7-latest /bin/bash
  3. 成功捕獲顯示卡 nvidia-smi
    image
    nvcc -V
    image
    ./test_cuda
    image
  4. 但執行demo項目,cd demos/style_fs2 && ./run.sh 出現error

Bug

  1. 缺失 libsndfile1-dev
    Traceback (most recent call last): File "style_syn.py", line 22, in <module> import soundfile as sf File "/usr/local/python3.7.0/lib/python3.7/site-packages/soundfile.py", line 192, in <module> _snd = _ffi.dlopen(_explicit_libname) OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory
    我猜測,這是CUDA10.2官方docker的bug,里面缺少了libsndfile1-dev。
    當執行apt install libsndfile1-dev後,成功解決。

  2. 缺失 環境參數CUDA_VISIBLE_DEVICES
    Traceback (most recent call last): File "style_syn.py", line 228, in <module> main() File "style_syn.py", line 209, in main paddle.set_device("gpu") File "/usr/local/python3.7.0/lib/python3.7/site-packages/paddle/device/__init__.py", line 313, in set_device place = _convert_to_place(device) File "/usr/local/python3.7.0/lib/python3.7/site-packages/paddle/device/__init__.py", line 204, in _convert_to_place place = core.CUDAPlace(ParallelEnv().dev_id) OSError: (External) CUDA error(100), no CUDA-capable device is detected. [Hint: 'cudaErrorNoDevice'. This indicates that no CUDA-capable devices were detected by the installed CUDA driver. ] (at /paddle/paddle/phi/backends/gpu/cuda/cuda_info.cc:66)
    因缺失 環境參數CUDA_VISIBLE_DEVICES,導致PaddleSpeech失敗獲取GPU。
    import os os.environ["CUDA_VISIBLE_DEVICES"] = "0"
    當設置CUDA_VISIBLE_DEVICES=0後,成功解決。

Environment:

  • Docker: develop-gpu-cuda10.2-cudnn7-latest
  • CUDA: 10.2
  • CUDNN: 7

Suggestion

  1. 在docker develop-gpu-cuda10.2-cudnn7-latest 鏡像 再安裝 apt install libsndfile1-dev
  2. /demos/style_fs2/style_syn.py 新增 import os os.environ["CUDA_VISIBLE_DEVICES"] = "0"
@lizezheng
Copy link
Collaborator

非常感謝提出的寶貴建議,歡迎持續關注 paddlespeech 並貢獻代碼

@kenny-chen
Copy link
Author

非常感謝提出的寶貴建議,歡迎持續關注 paddlespeech 並貢獻代碼

你好,请问有develop-gpu-cuda10.2-cudnn7-latest的dockerfile吗?
这样我可以修改dockerfile代码。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants