Ubuntu 操作系统

<p><span style="font-size:16px"><strong>Debian方式安装</strong></span></p> <p><span style="font-size:16px"><strong>操作步骤</strong></span></p> <p>1.&nbsp; 安装存储库元数据,安装GPG密钥,更新apt-get缓存并安装CUDA:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:702px"> <tbody> <tr> <td style="background-color:#ededed; width:696px"> <p>&nbsp; &nbsp; $ sudo dpkg --install cuda-repo-&lt;distro&gt;-&lt;version&gt;.&lt;architecture&gt;.deb</p> <p>&nbsp; &nbsp; $ sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/&lt;distro&gt;/&lt;architecture&gt;/7fa2af80.pub</p> <p>&nbsp; &nbsp; $ sudo apt-get update</p> <p>&nbsp; &nbsp; $ sudo apt-get install cuda</p> </td> </tr> </tbody> </table> <p>2.&nbsp; 重启系统加载NVIDIA驱动。</p> <p>3.&nbsp; 修改PATH和LD_LIBRARY_PATH变量来设置开发环境:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:702px"> <tbody> <tr> <td style="background-color:#ededed; width:696px"> <p>&nbsp; &nbsp; $ export PATH = / usr / local / cuda- 9.2 / bin $ {PATH:+:$ {PATH}}</p> <p>&nbsp; &nbsp; $ export LD_LIBRARY_PATH = / usr / local / cuda- 9.2 / lib64 \</p> <p>&nbsp; &nbsp; $ {LD_LIBRARY_PATH:+:$ {LD_LIBRARY_PATH} }</p> </td> </tr> </tbody> </table> <p>4.&nbsp; 构建并运行:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <table border="1" cellpadding="1" cellspacing="1" style="width:702px"> <tbody> <tr> <td style="background-color:#ededed; width:696px"> <p>&nbsp; &nbsp; $ cuda-install-samples- 9.2 .sh~</p> <p>&nbsp; &nbsp; $ cd~ / NVIDIA_CUDA- 9.2 _Samples / 5_Simulations / nbody</p> <p>&nbsp; &nbsp; $ make</p> <p>&nbsp; &nbsp; $ ./nbody</p> </td> </tr> </tbody> </table> <p>&nbsp;</p> <p><span style="font-size:16px"><strong>Runfile方式安装</strong></span></p> <p><span style="font-size:16px"><strong>操作步骤</strong></span></p> <p>1.&nbsp; 禁用Nouveau驱动程序:</p> <p>(1)创建一个文件 /etc/modprobe.d/blacklist-nouveau.conf,具有以下内容:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:702px"> <tbody> <tr> <td style="background-color:#ededed; width:696px"> <p>&nbsp; &nbsp; blacklist nouveau</p> <p>&nbsp; &nbsp; options nouveau modeset = 0</p> </td> </tr> </tbody> </table> <p>(2)重新生成内核initramfs:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:702px"> <tbody> <tr> <td style="background-color:#ededed; width:696px">&nbsp; &nbsp; $ sudo update-initramfs -u</td> </tr> </tbody> </table> <p>2.&nbsp; 在系统内核引导参数的末尾添加<strong>3</strong>和<strong>nomodeset</strong>,重启系统。</p> <p>3.&nbsp; 以静默方式运行安装程序:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:702px"> <tbody> <tr> <td style="background-color:#ededed; width:696px">&nbsp; &nbsp; $ sudo sh cuda_ &lt;version&gt; _linux.run --silent</td> </tr> </tbody> </table> <p>4.&nbsp; 创建一个xorg.conf 文件:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:702px"> <tbody> <tr> <td style="background-color:#ededed; width:696px">&nbsp; &nbsp; $ sudo nvidia-xconfig</td> </tr> </tbody> </table> <p>5.&nbsp; 重启系统加载图形界面。</p> <p>6.&nbsp; 通过修改PATH和LD_LIBRARY_PATH变量来设置开发环境:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:702px"> <tbody> <tr> <td style="background-color:#ededed; width:696px"> <p>&nbsp; &nbsp; $ export PATH = / usr / local / cuda- 9.2 / bin $ {PATH:+:$ {PATH}}</p> <p>&nbsp; &nbsp; $ export LD_LIBRARY_PATH = / usr / local / cuda- 9.2 / lib64 \</p> <p>&nbsp; &nbsp; $ {LD_LIBRARY_PATH:+:$ {LD_LIBRARY_PATH} }</p> </td> </tr> </tbody> </table> <p>7.&nbsp; 构建并运行:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:702px"> <tbody> <tr> <td style="background-color:#ededed; width:696px"> <p>&nbsp; &nbsp; $ cuda-install-samples- 9.2 .sh~</p> <p>&nbsp; &nbsp; $ cd~ / NVIDIA_CUDA- 9.2 _Samples / 5_Simulations / nbody</p> <p>&nbsp; &nbsp; $ make</p> <p>&nbsp; &nbsp; $ ./nbody</p> </td> </tr> </tbody> </table> <p>&nbsp;</p>
以上内容是否解决了您的问题?
请补全提交信息!
咨询·建议

电话咨询

400-151-8800

邮件咨询

cloud@pingan.com

在线客服

工单支持

解决云产品相关技术问题