2022/12/5
安裝的分配 ( 一定成功 )
/(60%) 517120
/home(38%) 368541
/boot (2%) 7169
$ sudo gedit /etc/modprobe.d/blacklist-nouveau.conf
並寫入
blacklist nouveau
options nouveau modeset=0
$ sudo update-initramfs -u
重開機後輸入nvidia-smi會成功
sudo gedit ~/.bashrc,
export PATH=$PATH:/usr/local/cuda/bin
測試已成功安裝
cd /usr/local/cuda/samples/1_Utilities/deviceQuery
sudo make
./deviceQuery (即可成功)
解壓縮tar包
sudo cp include/* /usr/local/cuda/include
sudo cp lib/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn*
sudo chmod a+r /usr/local/cuda/lib64/libcudnn*
下載.deb
sudo dpkg -i cudnn-local-repo-ubuntu2204_amd64.deb
Test valid!
git clone https://github.com/li-weihua/cudnn_samples_v8
cd cudnn_samples_v8/mnistCUDNN
make clean && make
sudo apt install libfreeimage3 libfreeimage-dev
make clean && make
./mnistCUDNN
sudo apt-get install git-all -y
將Appimage設為Desktop Entry
sudo add-apt-repository ppa:appimagelauncher-team/stable
sudo apt-get update
sudo apt-get install appimagelauncher
-----------------------------------------------------------------------------------------------------------------(以下)
sudo apt-get install libmatio-dev
git clone https://github.com/nagadomi/distro.git ~/torch --recursive
cd ~/torch
./install-deps ./clean.sh ./update.sh
~/torch/install/bin/torch-activate
luarocks install nn
luarocks install nngraph
luarocks install torch
luarocks install matio
luarocks install cutorch
luarocks install luautf8
cd extra/cutorch
export TORCH_NVCC_FLAGS="-D__CUDA_NO_HALF_OPERATORS__" (每一指令前都先下這行)
luarocks make rocks/cutorch-scm-1.rockspec
luarocks build rocks/cutorch-scm-1.rockspec
cd ~/torch/extra/cunn
luarocks make rocks/cunn-scm-1.rockspec
cd ~/torch/extra/cudnn
luarocks make cudnn-scm-1.rockspec
luarocks build cudnn-scm-1.rockspec
luarocks install hdf5
git clone https://github.com/nagadomi/cutorch.git
****************************************************************************
* cutorch安裝不成功的方法 https://reurl.cc/ZGaYa3 *
* (可嘗試 ) TORCH_NVCC_FLAGS="-D__CUDA_NO_HALF_OPERATORS__" ./install.sh
* 搭配 ./update
* https://zhuanlan.zhihu.com/p/55120414
****************************************************************************
報錯:file.lua:10: HDF5File.__init() requires a fileID - perhaps you want HDF5File.create()?stack traceback:
解方 1.(https://blog.csdn.net/uniqueyyc/article/details/82688158) 2. ffi.lua (8->10)
git clone https://github.com/anibali/torch-hdf5.git
cd torch-hdf5
git checkout hdf5-1.10
luarocks make hdf5-0-0.rockspec
$ sudo apt-get purge cmake
$ git clone https://github.com/Kitware/CMake.git
$ cd CMake
$ ./bootstrap if Error run sudo apt-get install libssl-dev
make
sudo make install
安裝lua
到官網中下載
make linux test
make install
到桌面
create a file named testok.lua 寫一行 print(“pass”)
lua testok.lua 印的出來就是成功
先 sudo apt-get install libhdf5-serial-dev
再 ~/torch/install/bin/luarocks install hdf5 (正確方式)
如果出現Error: No results matching query were found.
sudo rm -rf ~/.cache/luarocks
若要使用gcc-6 g++-6編譯須安裝https://arabelatso.github.io/2020/01/05/Install%20lua5.2%20luarocks%20and%20torch7%20on%20Ubuntu18.0.4%20with%20CUDA9.1/
sudo apt-get install gcc-6 g++-6 -y
GCC降級方法
$ sudo apt remove gcc
$ sudo apt-get install gcc-7 g++-7 -y
$ sudo ln -s /usr/bin/gcc-7 /usr/bin/gcc
$ sudo ln -s /usr/bin/g++-7 /usr/bin/g++
$ gcc --version
require 'cudnn' 只能在5~6間問題解決 2021/05/30
https://github.com/soumith/cudnn.torch/issues/359
git clone https://github.com/soumith/cudnn.torch.git -b R6
cd cudnn.torch && luarocks make cudnn-scm-1.rockspec
可以試裝
https://www.gitmemory.com/issue/torch/cutorch/834/681345647
https://github.com/nagadomi/distro
https://github.com/torch/cutorch/issues/834
https://stackoverflow.com/questions/52501760/cmake-error-while-installing-torch-in-ubuntu