Ubunt14.04+Nvidia drivers+cuda 8.0
首先,cuda自带ubuntu driver,但笔者从未试过是否能用。
Ubuntu linux kernel:
3.16.0-031600-generic #201408031935 SMP Sun Aug 3 23:36:11 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Nvidia driver 是通过apt-get 安装的。
Cuda 用deb安装,会给你安装一堆nvidia drivers,还卸载不掉。最后还是得用run文件安装。
run文件安装,又会老是报空间不够。
Action | Options Used | Explanation |
---|---|---|
Silent Installation | --silent | Required for any silent installation. Performs an installation with no further user-input and minimal command-line output based on the options provided below. Silent installations are useful for scripting the installation of CUDA. Using this option implies acceptance of the EULA. The following flags can be used to customize the actions taken during installation. At least one of --driver, --uninstall, --toolkit, and --samples must be passed if running with non-root permissions. |
--driver | Install the CUDA Driver. | |
--toolkit | Install the CUDA Toolkit. | |
--toolkitpath= |
Install the CUDA Toolkit to the |
|
--samples | Install the CUDA Samples. | |
--samplespath= |
Install the CUDA Samples to the |
|
--uninstall (DEPRECATED) | Unnstall the CUDA Driver. | |
Extraction | --extract= |
|
Extracts the individual driver, toolkit, and samples runfile installers to |
||
This is especially useful when one wants to install the driver using one or more of the command-line options provided by the driver installer which are not exposed in this installer. | ||
Overriding Installation Checks | --override | Ignores compiler, third-party library, and toolkit detection checks which would prevent the CUDA Toolkit and CUDA Samples from installing. |
No OpenGL Libraries | --no-opengl-libs | Prevents the driver installation from installing NVIDIA's GL libraries. Useful for systems where the display is driven by a non-NVIDIA GPU. In such systems, NVIDIA's GL libraries could prevent X from loading properly. |
Overriding Kernel Source | --kernel-source-path= |
Tells the driver installation to use |
Running nvidia-xconfig | --run-nvidia-xconfig | Tells the driver installation to run nvidia-xconfig to update the system X configuration file so that the NVIDIA X driver is used. The pre-existing X configuration file will be backed up. |
Custom Temporary Directory Selection | --tmpdir= |
Performs any temporary actions within |
Show Verbose Output | --verbose | Prints all logging information to stdout as well as the log file. |
Show Installer Options | --help | Prints the list of command-line options to stdout. |
使用参数
--tmpdir=/home/ubuntu/cuda/
注意,这里有一些博客创建的路径是/opt/usr/,但我还是失败了,又换了一个位置,成功。
然而,最后我还是把deb安装的nvidia driver卸载掉了,用了cuda内置的driver。因为在deb安装的driver版本比较老,跑不起来cuda的用例:
sudo /usr/local/cuda-8.0/samples/1_Utilities/deviceQuery/deviceQuery
为了运行zh.d2l.ai的gpu示例代码,发现运行不了的原因是,gluon默认安装的mxnet不是gpu版本的。
根据cuda的版本,在conda环境下安装即可。
conda activate gluon
pip install -U --pre mxnet-cu80 -i https://pypi.tuna.tsinghua.edu.cn/simple
使用清华的源安装。