tensorflow ImportError: libcublas.so.10.0 CUDA 설치 ubuntu
ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory
tensorflow 최신버전을 설치 후 import 할때 이런 경우가 발생하였는데
CUDA 10.0을 설치 해주면 된다.
How to Install Nvidia CUDA Toolkit on Ubuntu 16.04 LTS
설치 방법은
Download cuda version (deb-local) using this website:
https://developer.nvidia.com/cuda-downloads
자신에게 맞는 버전을 선택해서 다운로드
필자는 Linux Ubuntu 16.04 x86_64 를 선택 하였다.
정상 동작 한다면 여기 까지만 .....
그래서
nawan@sptechlab:~$ chmod 755 NVIDIA-Linux-x86_64-340.107.run
에러 발생..
nouveau 모듈 사용 확인
그러나! 위 샘플을 실행 하니.. 35에러..
해당 버전들이 지원하지 않기 때문에
이후 정상 동작 확인 할 수 있었다.
다시 한번 그러나 이 포스팅의 주제는 'tensorflow ImportError: libcublas.so.10.0' 에러 해결 인데 6.5를 설치 하였다.
그래서 CUDA 6.5 를 실행 하지만 libcublas.so.10.0 에러 해결을 위해 10.0 도 설치 하였다.
위 문제점을 해결 하기 위해 위 패키지들 설치 제거만 30번은 시도 한거 같다. 10.0 설치 이후 libcudnn.so.7 에러도 또 발생하게 된다. 결국 tensorflow 파이썬 스크립트에서 문제가 계속 되어 GPU 를 사용 하지 않거나 GPU를 업그레이드 하려 한다.
tensorflow 최신버전을 설치 후 import 할때 이런 경우가 발생하였는데
CUDA 10.0을 설치 해주면 된다.
How to Install Nvidia CUDA Toolkit on Ubuntu 16.04 LTS
설치 방법은
Download cuda version (deb-local) using this website:
https://developer.nvidia.com/cuda-downloads
자신에게 맞는 버전을 선택해서 다운로드
필자는 Linux Ubuntu 16.04 x86_64 를 선택 하였다.
wget https://developer.nvidia.com/compute/cuda/10.0/Prod/local_installers/cuda-repo-
ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64
mv cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64 cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
sudo apt-key add /var/cuda-repo-10-0-local-10.0.130-410.48/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda
vim .bashrc
export PATH=$PATH:/usr/local/cuda-10.0/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-10.0/lib64
source .profile
nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130
CUDA 10.0이 정상 설치 된 것을 확인 할수 있다.ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64
mv cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64 cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
sudo apt-key add /var/cuda-repo-10-0-local-10.0.130-410.48/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda
vim .bashrc
export PATH=$PATH:/usr/local/cuda-10.0/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-10.0/lib64
source .profile
nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130
정상 동작 한다면 여기 까지만 .....
그래서
cd /usr/local/cuda-10.0/samples
sudo make
./deviceQuery
./bandwidthTest
하려 하였지만 ./deviceQuery 에러..sudo make
./deviceQuery
./bandwidthTest
./deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
cudaGetDeviceCount returned 38
-> no CUDA-capable device is detected
Result = FAIL
CUDA Device Query (Runtime API) version (CUDART static linking)
cudaGetDeviceCount returned 38
-> no CUDA-capable device is detected
Result = FAIL
nawan@sptechlab:~$ chmod 755 NVIDIA-Linux-x86_64-340.107.run
nawan@sptechlab:~$ ./NVIDIA-Linux-x86_64-340.107.run
에러 발생..
ERROR: The Nouveau kernel driver is currently in use by your system. This driver is incompatible with the NVIDIA driver, and must be disabled before proceeding. Please consult the NVIDIA driver README and your Linux distribution's documentation for details on how to correctly disable the Nouveau kernel driver.
이럴 경우에 대한 해결 방법.nouveau 모듈 사용 확인
nawan@sptechlab:~$ lsmod | grep nouveau
nouveau 1503232 1
mxm_wmi 16384 1 nouveau
wmi 20480 2 mxm_wmi,nouveau
video 40960 1 nouveau
i2c_algo_bit 16384 1 nouveau
ttm 98304 1 nouveau
drm_kms_helper 155648 1 nouveau
drm 364544 4 ttm,drm_kms_helper,nouveau
blacklist에 nouveau 추가 하여 로드 되지 않게한다.nouveau 1503232 1
mxm_wmi 16384 1 nouveau
wmi 20480 2 mxm_wmi,nouveau
video 40960 1 nouveau
i2c_algo_bit 16384 1 nouveau
ttm 98304 1 nouveau
drm_kms_helper 155648 1 nouveau
drm 364544 4 ttm,drm_kms_helper,nouveau
nawan@sptechlab:~$ modprobe -r nouveau
sudo vim /etc/modprobe.d/blacklist.conf
blacklist nouveau //add this line in the end
sudo echo options nouveau modeset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf
sudo update-initramfs -u
sudo reboot
sudo ./NVIDIA-Linux-x86_64-340.107.run
sudo vim /etc/modprobe.d/blacklist.conf
blacklist nouveau //add this line in the end
sudo echo options nouveau modeset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf
sudo update-initramfs -u
sudo reboot
sudo ./NVIDIA-Linux-x86_64-340.107.run
nvidia-smi 명령어로 GeForce 9500GT 드라이버가 정상 설치 된 것을 확인 할수 있다.
./deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
cudaGetDeviceCount returned 35
-> CUDA driver version is insufficient for CUDA runtime version
Result = FAIL
CUDA Device Query (Runtime API) version (CUDART static linking)
cudaGetDeviceCount returned 35
-> CUDA driver version is insufficient for CUDA runtime version
Result = FAIL
GeForce 9500GT 의 드라이버 버전은 340.107 이었고 340은 CUDA 6.5 까지만 지원 된다.
10.0이 아닌 6.5를 설치 했어야 했다.
이 드라이버 설치 방법은 할 필요 없이 CUDA 6.5 패키지 설치시 같이 설치 되게 된다.
nawan@sptechlab:~$ cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module 340.107 Thu May 24 21:54:01 PDT 2018
GCC version: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.11)
nawan@sptechlab:~$ nvidia-smi
Fri Feb 15 14:57:53 2019
+------------------------------------------------------+
| NVIDIA-SMI 340.107 Driver Version: 340.107 |
|-------------------------------+----------------------+----------------------+
| 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 9500 GT Off | 0000:01:00.0 N/A | N/A |
| 20% 56C P0 N/A / N/A | 3MiB / 511MiB | N/A Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Compute processes: GPU Memory |
| GPU PID Process name Usage |
|=============================================================================|
| 0 Not Supported |
+-----------------------------------------------------------------------------+
NVRM version: NVIDIA UNIX x86_64 Kernel Module 340.107 Thu May 24 21:54:01 PDT 2018
GCC version: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.11)
nawan@sptechlab:~$ nvidia-smi
Fri Feb 15 14:57:53 2019
+------------------------------------------------------+
| NVIDIA-SMI 340.107 Driver Version: 340.107 |
|-------------------------------+----------------------+----------------------+
| 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 9500 GT Off | 0000:01:00.0 N/A | N/A |
| 20% 56C P0 N/A / N/A | 3MiB / 511MiB | N/A Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Compute processes: GPU Memory |
| GPU PID Process name Usage |
|=============================================================================|
| 0 Not Supported |
+-----------------------------------------------------------------------------+
해당 버전들이 지원하지 않기 때문에
CUDA10.0 을 지우고 6.5를 재설치 한다.
16.04 LTS 서버이지만 없기 때문에 14.04 를 받았다.
sudo wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_6.5-14_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1404_6.5-14_amd64.deb
sudo apt update
sudo apt install libcuda1-340 cuda-6-5 nvidia-340-dev nvidia-opencl-icd-340 cuda-runtime-6-5
nawan@sptechlab:/usr/local/cuda/samples/1_Utilities/deviceQuery$ ./deviceQuery
./deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
Detected 1 CUDA Capable device(s)
Device 0: "GeForce 9500 GT"
CUDA Driver Version / Runtime Version 6.5 / 6.5
CUDA Capability Major/Minor version number: 1.1
Total amount of global memory: 511 MBytes (536150016 bytes)
( 4) Multiprocessors, ( 8) CUDA Cores/MP: 32 CUDA Cores
GPU Clock rate: 1400 MHz (1.40 GHz)
Memory Clock rate: 400 Mhz
Memory Bus Width: 128-bit
Maximum Texture Dimension Size (x,y,z) 1D=(8192), 2D=(65536, 32768), 3 D=(2048, 2048, 2048)
Maximum Layered 1D Texture Size, (num) layers 1D=(8192), 512 layers
Maximum Layered 2D Texture Size, (num) layers 2D=(8192, 8192), 512 layers
Total amount of constant memory: 65536 bytes
Total amount of shared memory per block: 16384 bytes
Total number of registers available per block: 8192
Warp size: 32
Maximum number of threads per multiprocessor: 768
Maximum number of threads per block: 512
Max dimension size of a thread block (x,y,z): (512, 512, 64)
Max dimension size of a grid size (x,y,z): (65535, 65535, 1)
Maximum memory pitch: 2147483647 bytes
Texture alignment: 256 bytes
Concurrent copy and kernel execution: Yes with 1 copy engine(s)
Run time limit on kernels: No
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
Device supports Unified Addressing (UVA): No
Device PCI Bus ID / PCI location ID: 1 / 0
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simu ltaneously) >
deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 6.5, CUDA Runtime Versi on = 6.5, NumDevs = 1, Device0 = GeForce 9500 GT
Result = PASS
sudo dpkg -i cuda-repo-ubuntu1404_6.5-14_amd64.deb
sudo apt update
sudo apt install libcuda1-340 cuda-6-5 nvidia-340-dev nvidia-opencl-icd-340 cuda-runtime-6-5
nawan@sptechlab:/usr/local/cuda/samples/1_Utilities/deviceQuery$ ./deviceQuery
./deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
Detected 1 CUDA Capable device(s)
Device 0: "GeForce 9500 GT"
CUDA Driver Version / Runtime Version 6.5 / 6.5
CUDA Capability Major/Minor version number: 1.1
Total amount of global memory: 511 MBytes (536150016 bytes)
( 4) Multiprocessors, ( 8) CUDA Cores/MP: 32 CUDA Cores
GPU Clock rate: 1400 MHz (1.40 GHz)
Memory Clock rate: 400 Mhz
Memory Bus Width: 128-bit
Maximum Texture Dimension Size (x,y,z) 1D=(8192), 2D=(65536, 32768), 3 D=(2048, 2048, 2048)
Maximum Layered 1D Texture Size, (num) layers 1D=(8192), 512 layers
Maximum Layered 2D Texture Size, (num) layers 2D=(8192, 8192), 512 layers
Total amount of constant memory: 65536 bytes
Total amount of shared memory per block: 16384 bytes
Total number of registers available per block: 8192
Warp size: 32
Maximum number of threads per multiprocessor: 768
Maximum number of threads per block: 512
Max dimension size of a thread block (x,y,z): (512, 512, 64)
Max dimension size of a grid size (x,y,z): (65535, 65535, 1)
Maximum memory pitch: 2147483647 bytes
Texture alignment: 256 bytes
Concurrent copy and kernel execution: Yes with 1 copy engine(s)
Run time limit on kernels: No
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
Device supports Unified Addressing (UVA): No
Device PCI Bus ID / PCI location ID: 1 / 0
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simu ltaneously) >
deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 6.5, CUDA Runtime Versi on = 6.5, NumDevs = 1, Device0 = GeForce 9500 GT
Result = PASS
이후 정상 동작 확인 할 수 있었다.
다시 한번 그러나 이 포스팅의 주제는 'tensorflow ImportError: libcublas.so.10.0' 에러 해결 인데 6.5를 설치 하였다.
그래서 CUDA 6.5 를 실행 하지만 libcublas.so.10.0 에러 해결을 위해 10.0 도 설치 하였다.
위 문제점을 해결 하기 위해 위 패키지들 설치 제거만 30번은 시도 한거 같다. 10.0 설치 이후 libcudnn.so.7 에러도 또 발생하게 된다. 결국 tensorflow 파이썬 스크립트에서 문제가 계속 되어 GPU 를 사용 하지 않거나 GPU를 업그레이드 하려 한다.
댓글
댓글 쓰기