ubuntu12.04搭建CUDA4.2开发环境

2023-11-11

实验室老师让调试一个DeepLearning的程序,叫做DropConnecte,必须要在64bit的Linux系统上运行,还要配置CUDA,本人比较笨,重装了好多次Ubuntu之后才整成功,特把整理的资料发到这里

1,动态链接库解决方案http://blog.csdn.net/aquakguo0he1/article/details/9764063



3 显卡问题http://www.linuxidc.com/Linux/2012-08/68629.htm
http://wla137996229.blog.163.com/blog/static/656993572013754243238/
4.ubuntu论坛http://ubuntuforums.org/showthread.php?t=1722306
一,安装python依赖包
sudo apt-get update
sudo apt-get install python-dev 
sudo apt-get install python-numpy
sudo apt-get install python-magic
sudo apt-get install python-matplotlib
sudo apt-get install libatlas-base-dev
二,安装boost
sudo apt-get install libboost-dev
三,安装各种依赖包
sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev




附 :
在安装cuda samples的时候需要一个贡献库文件libglut.so,默认没有安装,在终端下输入:
sudo apt-get install freeglut3
这个共享库对于32位的Ubuntu被安装在/usr/lib/i386-linux-gnu/libglut.so.3,而对于64位的Ubuntu被安装在 /usr/lib/x86_64-linux-gnu/libglut.so.3,但cuda默认会去寻找/usr/lib/libglut.so,因此我们还需要加一个软链接:
对于64位系统,在终端下输入:
sudo ln -s /usr/lib/x86_64-linux-gnu/libglut.so.3 /usr/lib/libglut.so


四,将原有驱动加入黑名单
gedit /etc/modprobe.d/blacklist.conf
blacklist amd76x_edac
blacklist vga16fb
blacklist nouveau
blacklist rivafb
blacklist nvidiafb
blacklist rivatv
五,卸载原有驱动
sudo apt-get remove --purge nvidia*
六,Xwidows操作安装驱动
sudo service lightdm stop
chmod +x。。。。。
七,安装cudatoolkit
cd /media/Work/ubuntu/cudainstallfile
sudo chmod +x cudatoolkit_4.2.9_linux_64_ubuntu11.04.run
sudo cudatoolkit_4.2.9_linux_64_ubuntu11.04.run


八,修改配置文件
gedit ~/.bashrc
    1,在bashrc文本末尾添加如下内容:
export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/lib/nvidia-current:$LD_LIBRARY_PATH
export CUDA_ROOT=/usr/local/cuda/bin


2,在sudo gedit /etc/ld.so.conf添加
/usr/local/cuda/lib64
        /lib
九,安装SDK
cd /home/laonan/NVIDIA_GPU_Computing_SDK/C
sudo make
 测试安装是否成功
cd /home/laonan/NVIDIA_GPU_Computing_SDK/C/bin/linux/release


十,常见问题解决
1,编译时若是出现类似这样的问题:


    /usr/bin/ld: cannot find -lXi
    /usr/bin/ld: cannot find -lXmu
    /usr/bin/ld: cannot find -lglut
    collect2: ld returned 1 exit status


是表示有一些必要的 Library 没装,用 apt-cache 找一下再用 apt-get 装起来就可以了:


apt-get install libxi-dev libxmu-dev libglut3-dev


2,若出现


    /usr/bin/ld: cannot find -lcuda
    collect2: ld returned 1 exit status





    /usr/bin/ld: cannot find -lGL
    collect2: ld returned 1 exit status


是表示找不到 NVIDIA GL 或 CUDA Library,若是您是使用 Ubuntu 内建的驱动程式管理介面安装的 NVIDIA Driver,则将 /usr/lib/nvidia-current 下面的 so 档件一个连结到 /usr/lib 下面即可:


sudo ln -s /usr/lib/nvidia-current/libcuda.so /usr/lib/libcuda.so
sudo ln -s /usr/lib/nvidia-current/libGL.so /usr/lib/libGL.so




3,解决分辨率变低的问题
 (1)sudo apt-get install v86d


(2)gksu gedit /etc/default/grub
enter your password when asked and hit the Enter key.


- Replace the following line (line number 9):


GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"


with this one:


GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset video=uvesafb:mode_option=1280x1024-24,mtrr=3,scroll=ywrap"


- Replace the following line (line number 18):


#GRUB_GFXMODE=640x480


with this one:


GRUB_GFXMODE=1280x1024


save the file and close it!
(3)gksu gedit /etc/initramfs-tools/modules


When the text window appears, add the following line at the end of the file:


uvesafb mode_option=1280x1024-24 mtrr=3 scroll=ywrap
(4)
echo FRAMEBUFFER=y | sudo tee /etc/initramfs-tools/conf.d/splash


you will get right result like this:FRAMEBUFFER=y
(5)sudo update-grub2
(6)sudo update-initramfs -u


第二种解决分辨率的方法
编辑 gedit /etc/X11/xorg.conf
Section "Device"
   Identifier    "Configured Video Device"
EndSection


Section "Monitor"
   Identifier    "Configured Monitor"
   Horizsync 30-81
   Vertrefresh 56-75
EndSection


Section "Screen"
   Identifier    "Default Screen"
   Monitor        "Configured Monitor"
   Device        "Configured Video Device"
   SubSection "Display"
   Modes "1024x768" "1152x864"
   EndSubSection
EndSection


如果你的xorg.conf编写不正确,导致进不了桌面,请在开机的时候选择recovery mode进入,以root身份登陆文本界面,输入:


rm /etc/X11/xorg.conf


这个命令会删除掉xorg.conf文件


问题三:undefined reference to `gluErrorString'


1) change the order for all occurrences of RENDERCHECKLIB in BOTH /C/common/common.mk and /CUDALibraries/common/common_cudalib.mk like this:


OLD:
LIB += ${OPENGLLIB} $(PARAMGLLIB) $(RENDERCHECKGLLIB) ${LIB} -ldl -rdynamic


NEW:
LIB += $(RENDERCHECKGLLIB) ${OPENGLLIB} $(PARAMGLLIB) ${LIB} -ldl –rdynamic


and add -L../../../C/lib in common_cudalib.mk RENDERCHECKGLLIB definition line:


OLD:
RENDERCHECKGLLIB := -lrendercheckgl_$(LIB_ARCH)$(LIBSUFFIX)


 


NEW:
RENDERCHECKGLLIB := -L../../../C/lib -lrendercheckgl_$(LIB_ARCH)$(LIBSUFFIX)


2) In all files that use UtilNPP (boxFilterNPP, imageSegmentationNPP, freeImageInteropNPP, histEqualizationNPP), the makefiles have the wrong order of library linking ($LIB is before the source/out files), so go to the /CUDALibraries/src/*NPP/Makefile and change the order like (note this is an example of the freeImageInteropNPP file modification, all others are done similarly):


OLD:
$(CXX) $(INC) $(LIB) -o freeImageInteropNPP freeImageInteropNPP.cpp -lUtilNPP_$(LIB_ARCH) -lfreeimage$(FREEIMAGELIBARCH)


 


NEW:
$(CXX) $(INC) -o freeImageInteropNPP freeImageInteropNPP.cpp $(LIB) -lUtilNPP_$(LIB_ARCH) -lfreeimage$(FREEIMAGELIBARCH)


3) For randomFog, you also need to add
USERENDERCHECKGL := 1
to the Makefile.




附:glx问题
http://superuser.com/questions/484991/nvidia-graphics-driver-in-ubuntu-12-04
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

ubuntu12.04搭建CUDA4.2开发环境 的相关文章

随机推荐

  • java 图片验证码

    image jsp 主要是采用下面导入的几个包来绘制 验证码图片
  • 【activiti 入门】springboot 集成activiti6.0的demo

    环境 jdk 1 8 maven 3 0 IDEA插件之actiBPM springboot2 0 activiti6 0 mysql数据库 具体demo地址 https download csdn net download qq 3333
  • ThreadCreationCmp

    package io github viscent mtia ch1 import io github viscent mtia util Tools public class ThreadCreationCmp public static
  • 时序预测

    时序预测 MATLAB实现SSA GRU 麻雀算法优化门控循环单元 时间序列预测 目录 时序预测 MATLAB实现SSA GRU 麻雀算法优化门控循环单元 时间序列预测 预测效果 基本介绍 模型介绍 程序设计 参考资料 预测效果 基本介绍
  • WCF:The maximum string content length quota (8192) has been exceeded while reading XML data

    修改接收端的WCF config文件 注意 如果server端接收request超长 则修改server端config 如果是client 接收response超长 则修改client端 建议两边都修改 保持一致
  • Linux下使用smbclient传输文件夹(包括文件)脚本

    遍历文件夹 是文件就put上去 不是文件就创建目录 根据自己的需求改一下前面的directory serverpath des directory就可以用了 在代码中smbclient中使用了 N 因为我用的是匿名登录 加了 N就不需要提示
  • nodejs,zip压缩版安装与配置

    下载zip包 下载 Node js 解压 将文件解压到要安装的位置 并新建两个目录node global npm全局安装位置node cache npm 缓存路径 配置环境变量 NODE PATH D Program Files node
  • GridView和CheckBox结合[转]

    效果图 后台代码 Code 1using System 2using System Data 3using System Configuration 4using System Web 5using System Web Security
  • 算法:反转链表 java

    方法1 迭代 public static Node reverseNode Node head 前一个节点 Node pre null 当前节点 Node cur head 如果当前节点不为空 while cur null 存储下一个节点
  • 《数学建模实战攻略:引言》

    一 专栏简介与目标 欢迎来到 数学建模实战攻略 专栏 本专栏旨在帮助初学者 参加数学建模竞赛的学生以及对数学建模感兴趣的研究者和开发者全面了解数学建模的知识体系 掌握建模方法和技巧 提高解决实际问题的能力 本专栏将涵盖数学建模的基本概念 方
  • ALSA信息查看

    1 1 1 查看当前Soc的声卡状态 cat proc asound cards 例如 插入USB声卡之后 会新增声卡节点 USB声卡无声可优先查看该状态 1 1 2 查看当前声卡工作状态 声卡分两种通道 一种是Capture 一种是Pla
  • web的欢迎资源文件

    欢迎资源文件 1 前提 用户可以记住网站名 但是不会记住网站资源文件名 2 默认欢迎资源文件 用户发送了一个针对某个网站的 默认请求 时 此时由Http服务器自动从当前网站返回的资源文件 正常请求 http localhost 8080 m
  • 关于Electron 串口通讯serialport 打包的问题

    请教各位大佬一下 我使用serialport模块 程序编译后正常运行 但是无法打包 目前搞不清楚原因 特来请教 PS C Users appyjj Desktop cart gt npm run build gt cart 1 0 0 bu
  • 学会项目成本管理计算,PMP计算题就是送分题

    学会项目成本管理计算 PMP计算题就是送分题 PMP中的计算主要在 lt 项目成本管理 gt 的控制成本部分 服务于挣值管理 EVM Earned Value Management 挣值分析 EVA Earned Value Analysi
  • MySQL学习日记day04(索引、视图、DBA常用命令、数据库设计三范式)

    目录 一 索引 index 1 什么是索引 2 索引的实现原理 3 在mysql当中 主键上 以及unique字段上都会自动添加索引的 4 索引怎么创建 怎么删除 语法是什么 5 在mysql当中 怎么查看一个SQL语句是否使用了索引进行检
  • Node.js 下载安装环境配置 - 图文版

    Node js 是一个开源 跨平台的 JavaScript 运行时环境 一 介绍 1 官方文档 1 中文文档 Node js 中文网 2 英文文档 Node js 二 下载 1 中文 2 英文 编辑三 安装 1 新建一个文件夹作为安装路径
  • Win11家庭版怎么开启远程桌面

    Win11家庭是专为家庭用户准备的版本 由于Win11系统是一款全新的系统 很多用户对一些功能还不是很熟悉 那么Win11家庭版怎么开启远程桌面 下面就来看看详细教程 Win11家庭版开启远程桌面教程 1 首先 我们需要先下载安装一款远程桌
  • 黑马程序员--多线程

    黑马程序员 多线程 Java培训 Android培训 iOS培训 Net培训 期待与您交流 一 定义 进程 是一个正在执行中的程序 每一个进程执行都有一个执行顺序 该顺序是一个执行路径或叫控制单元 线程 进程中的一个独立的控制单元 线程在控
  • Ubuntu32位安装VSCODE

    Ubuntu32位安装VSCODE vscode自1 36版本后停止支持32位linux系统 所以要使用 lt 1 36版本 vscode所有版本下载地址 https code visualstudio com updates v1 33
  • ubuntu12.04搭建CUDA4.2开发环境

    实验室老师让调试一个DeepLearning的程序 叫做DropConnecte 必须要在64bit的Linux系统上运行 还要配置CUDA 本人比较笨 重装了好多次Ubuntu之后才整成功 特把整理的资料发到这里 1 动态链接库解决方案h