Guide of Installing CUDA-7.5 on Ubuntu 14.04

Guide of Installing CUDA-7.5 on Ubuntu 14.04

I have struggled a whole day to install the driver of Nvidia GTX 970 on Ubuntu. In this blog, you will learn step by step to pre-configure your Linux and run the installation run-file. I hope this blog will save your time. You are welcome!


[1] PRE-INSTALLATION ACTIONS

(1)Verify You Have a CUDA-Capable GPU

To verify that your GPU is CUDA-capable, go to your distribution’s equivalent of System Properties, or, from the command line, enter:

$ lspci | grep -i nvidia

If you do not see any settings, update the PCI hardware database that Linux maintains by entering update-pciids (generally found in /sbin) at the command line and rerun the previous lspci command.

If your graphics card is from NVIDIA and it is listed in http://developer.nvidia.com/ cuda-gpus, your GPU is CUDA-capable.

The Release Notes for the CUDA Toolkit also contain a list of supported products.

(2) Verify You Have a Supported Version of Linux

The CUDA Development Tools are only supported on some specific distributions of Linux. These are listed in the CUDA Toolkit release notes.
To determine which distribution and release number you’re running, type the following at the command line:

$ uname -m && cat /etc/*release

You should see output similar to the following, modified for your particular system:

x86_64
Red Hat Enterprise Linux Workstation release 6.0 (Santiago)

The x86_64 line indicates you are running on a 64-bit system. The remainder gives information about your distribution.

(3) Verify the System Has gcc Installed

The gcc compiler is required for development using the CUDA Toolkit. It is not required for running CUDA applications. It is generally installed as part of the Linux installation, and in most cases the version of gcc installed with a supported version of Linux will work correctly.

To verify the version of gcc installed on your system, type the following on the command line:

$ gcc --version

If an error message displays, you need to install the development tools from your Linux distribution or obtain a version of gcc and its accompanying toolchain from the Web.

(4) Verify the System has the Correct Kernel Headers and Development Packages Installed

The CUDA Driver requires that the kernel headers and development packages for the running version of the kernel be installed at the time of the driver installation, as well whenever the driver is rebuilt. For example, if your system is running kernel version 3.17.4-301, the 3.17.4-301 kernel headers and development packages must also be installed.

While the Runfile installation performs no package validation, the RPM and Deb installations of the driver will make an attempt to install the kernel header and development packages if no version of these packages is currently installed. However, it will install the latest version of these packages, which may or may not match the version of the kernel your system is using. Therefore, it is best to manually ensure the correct version of the kernel headers and development packages are installed prior to installing the CUDA Drivers, as well as whenever you change the kernel version.

The version of the kernel your system is running can be found by running the following command:

$ uname -r

This is the version of the kernel headers and development packages that must be installed prior to installing the CUDA Drivers. This command will be used multiple times below to specify the version of the packages to install. Note that below are the common-case scenarios for kernel usage. More advanced cases, such as custom kernel branches, should ensure that their kernel headers and sources match the kernel build they are running.

The kernel headers and development packages for the currently running kernel can be installed with:

$ sudo apt-get install linux-headers-$(uname -r)

[2] RUNFILE INSTALLATION

Perform the following steps to install CUDA and verify the installation.

Because the GPU cannot be recognized by Ubuntu 14.04 automatically, you have to use iGpu first to play with your system, and you can set this in your BIOS.

step 0: Shutdown the X window.

sudo service lightdm stop

step 1: Disable the Nouveau drivers

1. Create a file at /etc/modprobe.d/blacklist-nouveau.conf with the following contents:
blacklist nouveau
options nouveau modeset=0
2. Regenerate the kernel initramfs:
sudo update-initramfs -u

step 2: Reboot into runlevel 3

sudo init 3

step 3: Run the installer silently to install with the default selections (implies acceptance of the EULA):

sudo sh cuda_<version>_linux.run

After this step, you will see the installation failed. That maybe caused by you are using iGPU but not GPU. Now, you have to shutdown your computer and plug in your DVI cable on you GPU to connect with your screen and then enter your BIOS to set use GPU(maybe AUTO or PCIE). Although the previous installation has not successfully installed the whole CUDA, it still made the GPU driven to light the screen. With this GPU lighting screen, you need to repeat the previous four steps and you will see the successful installation.

step 4: Create an xorg.conf file to use the NVIDIA GPU for display

$ sudo nvidia-xconfig

Without this step, you will suffer from loop login.

step 5: Set up the development environment by modifying the PATH and LD_LIBRARY_PATH variables

You are recommended to add the following commands to your .bashrc

$ export PATH=/usr/local/cuda-7.5/bin:$PATH
$ export LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64:$LD_LIBRARY_PATH

step 6: Reboot the system to load the graphical interface.

Install OpenCV

When you make OpenCV, you should try the following command.

cd opencv-[version]/
mkdir build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D CUDA_GENERATION=Kepler ..
make -j 4
sudo make install

This blog refers to the manual of CUDA and some Q&As on the web.

Enjoy your research!

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要装TurtleBot,需要首先安装Ubuntu 14.04和ROS。关于Ubuntu和ROS的安装可参考。 安装Ubuntu 14.04的步骤如下: 1. 下载Ubuntu 14.04的ISO文件并创建安装盘。 2. 将安装盘插入计算机并启动。 3. 在安装界面中选择“安装Ubuntu”选项。 4. 按照屏幕上的指示完成安装过程。 安装ROS的步骤如下: 1. 打开终端,执行以下命令以添加ROS软件包源: ``` sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu trusty main" > /etc/apt/sources.list.d/ros-latest.list' ``` 2. 执行以下命令以设置ROS密钥: ``` wget http://packages.ros.org/ros.key -O - | sudo apt-key add - ``` 3. 执行以下命令以更新软件包索引: ``` sudo apt-get update ``` 4. 执行以下命令以安装ROS: ``` sudo apt-get install ros-indigo-desktop-full ``` 5. 执行以下命令以初始化ROS: ``` sudo rosdep init rosdep update echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc source ~/.bashrc ``` 6. 安装TurtleBot所需的依赖库: ``` sudo apt-get install ros-indigo-turtlebot ros-indigo-turtlebot-apps ros-indigo-turtlebot-interactions ros-indigo-turtlebot-simulator ros-indigo-kobuki-ftdi ``` 安装完成后,你就可以开始使用TurtleBot了。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [Installing Ubuntu 14.04 & ROS & TurtleBot 06-29-2016](https://download.csdn.net/download/baidu_14953535/9594283)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [Ubuntu 14.04, ros , turtlebot安装配置过程](https://blog.csdn.net/qq_25368751/article/details/80668255)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [在Ubuntu14.04中安装ROS Indigo](https://blog.csdn.net/weixin_41015581/article/details/80028576)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值