1.cuda/cudnn 安装
(base) ken@ken-gaint:/media/ken/blank/linux-cuda-cudnn$ ls -la 总用量 4777701 drwxrwxrwx 1 ken ken 568 8月 27 21:38 . drwxrwxrwx 1 ken ken 65536 8月 27 13:02 .. -rwxrwxrwx 2 ken ken 3046790184 5月 21 16:07 cuda_11.2.0_460.27.04_linux.run -rwxrwxrwx 2 ken ken 1845502929 5月 21 18:22 cudnn-11.3-linux-x64-v8.2.0.53.tgz
- cuda直接安装
- cudnn直接解压缩到安装目录
/usr/local/cuda-11.2
2.paddlepaddle-gpu安装
- 虚拟环境创建
- 清华源设置
- 虚拟环境创建
- paddlepaddle包安装
wget https://tuna.moe/oh-my-tuna/oh-my-tuna.py # For yourself python oh-my-tuna.py # ...or for everyone! sudo python oh-my-tuna.py --global # Get some help **python** oh-my-tuna.py -h
(base) ken@ken-gaint:~/Downloads$ conda create -n p2 python=3.9 Collecting package metadata (current_repodata.json): done Solving environment: done ==> WARNING: A newer version of conda exists. <== current version: 4.9.2 latest version: 4.14.0 Please update conda by running $ conda update -n base -c defaults conda ## Package Plan ## environment location: /home/ken/miniconda3/envs/p2 added / updated specs: - python=3.9 The following packages will be downloaded: package | build ---------------------------|----------------- _libgcc_mutex-0.1 | main 3 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main _openmp_mutex-5.1 | 1_gnu 21 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main ca-certificates-2022.07.19 | h06a4308_0 124 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main certifi-2022.6.15 | py39h06a4308_0 153 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main ld_impl_linux-64-2.38 | h1181459_1 654 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main libffi-3.3 | he6710b0_2 50 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main libgcc-ng-11.2.0 | h1234567_1 5.3 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main libgomp-11.2.0 | h1234567_1 474 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main libstdcxx-ng-11.2.0 | h1234567_1 4.7 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main ncurses-6.3 | h5eee18b_3 781 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main openssl-1.1.1q | h7f8727e_0 2.5 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main pip-22.1.2 | py39h06a4308_0 2.5 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main python-3.9.12 | h12debd9_1 19.2 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main readline-8.1.2 | h7f8727e_1 354 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main setuptools-63.4.1 | py39h06a4308_0 1.1 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main sqlite-3.39.2 | h5082296_0 1.1 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main tk-8.6.12 | h1ccaba5_0 3.0 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main tzdata-2022a | hda174b7_0 109 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main wheel-0.37.1 | pyhd3eb1b0_0 33 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main xz-5.2.5 | h7f8727e_1 339 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main zlib-1.2.12 | h7f8727e_2 106 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main ------------------------------------------------------------ Total: 42.4 MB The following NEW packages will be INSTALLED: _libgcc_mutex anaconda/pkgs/main/linux-64::_libgcc_mutex-0.1-main _openmp_mutex anaconda/pkgs/main/linux-64::_openmp_mutex-5.1-1_gnu ca-certificates anaconda/pkgs/main/linux-64::ca-certificates-2022.07.19-h06a4308_0 certifi anaconda/pkgs/main/linux-64::certifi-2022.6.15-py39h06a4308_0 ld_impl_linux-64 anaconda/pkgs/main/linux-64::ld_impl_linux-64-2.38-h1181459_1 libffi anaconda/pkgs/main/linux-64::libffi-3.3-he6710b0_2 libgcc-ng anaconda/pkgs/main/linux-64::libgcc-ng-11.2.0-h1234567_1 libgomp anaconda/pkgs/main/linux-64::libgomp-11.2.0-h1234567_1 libstdcxx-ng anaconda/pkgs/main/linux-64::libstdcxx-ng-11.2.0-h1234567_1 ncurses anaconda/pkgs/main/linux-64::ncurses-6.3-h5eee18b_3 openssl anaconda/pkgs/main/linux-64::openssl-1.1.1q-h7f8727e_0 pip anaconda/pkgs/main/linux-64::pip-22.1.2-py39h06a4308_0 python anaconda/pkgs/main/linux-64::python-3.9.12-h12debd9_1 readline anaconda/pkgs/main/linux-64::readline-8.1.2-h7f8727e_1 setuptools anaconda/pkgs/main/linux-64::setuptools-63.4.1-py39h06a4308_0 sqlite anaconda/pkgs/main/linux-64::sqlite-3.39.2-h5082296_0 tk anaconda/pkgs/main/linux-64::tk-8.6.12-h1ccaba5_0 tzdata anaconda/pkgs/main/noarch::tzdata-2022a-hda174b7_0 wheel anaconda/pkgs/main/noarch::wheel-0.37.1-pyhd3eb1b0_0 xz anaconda/pkgs/main/linux-64::xz-5.2.5-h7f8727e_1 zlib anaconda/pkgs/main/linux-64::zlib-1.2.12-h7f8727e_2 ############ ############ ############ Preparing transaction: done Verifying transaction: done Executing transaction: done # # To activate this environment, use # # $ conda activate p2 # # To deactivate an active environment, use # # $ conda deactivate (base) ken@ken-gaint:~/Downloads$ conda activate p2 ############ ############ (p2) ken@ken-gaint:~/Downloads$ python oh-my-tuna.py ############ ############ (p2) ken@ken-gaint:~/Downloads$ python -m pip install paddlepaddle-gpu==2.3.2.post112 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Looking in links: https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html Collecting paddlepaddle-gpu==2.3.2.post112 Downloading https://paddle-wheel.bj.bcebos.com/2.3.2/linux/linux-gpu-cuda11.2-cudnn8-mkl-gcc8.2-avx/paddlepaddle_gpu-2.3.2.post112-cp39-cp39-linux_x86_64.whl (396.0 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 396.0/396.0 MB 1.2 MB/s eta 0:00:00 Collecting decorator ############ ############
然后这样是失败的。。。
(p2) ken@ken-gaint:/media/ken/blank/linux-cuda-cudnn$ python Python 3.9.12 (main, Jun 1 2022, 11:38:51) [GCC 7.5.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information. >>> import paddle Error: Can not import avx core while this file exists: /home/ken/miniconda3/envs/p2/lib/python3.9/site-packages/paddle/fluid/core_avx.so Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/ken/miniconda3/envs/p2/lib/python3.9/site-packages/paddle/__init__.py", line 25, in <module> from .framework import monkey_patch_variable File "/home/ken/miniconda3/envs/p2/lib/python3.9/site-packages/paddle/framework/__init__.py", line 17, in <module> from . import random # noqa: F401 File "/home/ken/miniconda3/envs/p2/lib/python3.9/site-packages/paddle/framework/random.py", line 16, in <module> import paddle.fluid as fluid File "/home/ken/miniconda3/envs/p2/lib/python3.9/site-packages/paddle/fluid/__init__.py", line 36, in <module> from . import framework File "/home/ken/miniconda3/envs/p2/lib/python3.9/site-packages/paddle/fluid/framework.py", line 37, in <module> from . import core File "/home/ken/miniconda3/envs/p2/lib/python3.9/site-packages/paddle/fluid/core.py", line 298, in <module> raise e File "/home/ken/miniconda3/envs/p2/lib/python3.9/site-packages/paddle/fluid/core.py", line 256, in <module> from . import core_avx ImportError: /home/ken/miniconda3/envs/p2/lib/python3.9/site-packages/paddle/fluid/core_avx.so: undefined symbol: _dl_sym, version GLIBC_PRIVATE >>>
3.正确的办法
www.paddlepaddle.org.cn/documentati…
直接下载gcc8,然后自己编译。。。我哭晕了。