Ubuntu12.04 安装 CUDA 4.2 - XiZi's Blog

Ubuntu12.04 安装 CUDA 4.2

Xizi posted @ 2012年5月01日 21:33 in Develop with tags cuda ubuntu 4.2 12.04 , 7063 阅读

翻译自(http://d.hatena.ne.jp/iRiE/20120309/1331303439)

按照下列顺序进行安装

  1. Ubuntu 12.04
  2. NVIDIA 显卡驱动(devdriver_4.2_linux_64_295.41.run)
  3. cudatoolkit_4.2.9_linux_64_ubuntu11.04.run
  4. gpucomputingsdk_4.2.9_linux.run
  5. 代码编译依赖库

Ubuntu 12.04 安装

Ubuntu 的安装,网上教程不少,不会的自己百度一下。

NVIDIA 显卡驱动

sudo apt-get install nvidia-current

CUDA Toolkit

去NVIDIA的网站下载

sudo sh cudatoolkit_4.2.9_linux_64_ubuntu11.04.run

配置库,创建文件(/etc/ld.so.conf.d/cuda.conf)

## /etc/ld.so.conf.d/cuda.conf
/usr/local/cuda/lib64
/usr/local/cuda/lib

重新加载设置

sudo ldconfig

创建系统环境变量文件(/etc/profile.d/cuda.sh

## /etc/profile.d/cuda.sh
export PATH="/usr/local/cuda/bin:$PATH"
export LIBRARY_PATH="/usr/lib/nvidia-current:$LIBRARY_PATH"

修正"/usr/local/cuda/include/host_config.h"(话说这里还没实验,不知到需不需要)

--- host_config.orig.h  2012-01-27 17:20:57.689102815 +0900
+++ host_config.h       2012-01-27 17:29:32.037101532 +0900
@@ -79,7 +79,7 @@
 
 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5)
 
-#error -- unsupported GNU version! gcc 4.6 and up are not supported!
+//#error -- unsupported GNU version! gcc 4.6 and up are not supported!
 
 #endif /* __GNUC__> 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5) */

 

gpucomputingsdk

安装GPU_COMPUTING_SDK

sh gpucomputingsdk_4.2.9_linux.run

安装后,进入安装目录执行 make, 一般会出现以下错误。

../../lib/librendercheckgl_x86_64.a(rendercheck_gl.cpp.o): In function `CheckBackBuffer::checkStatus(char const*, int, bool)':
rendercheck_gl.cpp:(.text+0xfbb): undefined reference to `gluErrorString'

这是由于~/NVIDIA_GPU_Computing_SDK/C/common/common.mk 文件中,库文件的链接顺序问题引起的。这里主要受到库$(RENDERCHECKGLLIB)的影响,我们把这个库提前即可。

--- common.orig.mk      2012-01-27 14:34:13.129127766 +0900
+++ common.mk   2012-01-27 14:24:10.433129269 +0900
@@ -267,18 +267,18 @@
 
 # If dynamically linking to CUDA and CUDART, we exclude the libraries from the LIB
 ifeq ($(USECUDADYNLIB),1)
-     LIB += ${OPENGLLIB} $(PARAMGLLIB) $(RENDERCHECKGLLIB) ${LIB} -ldl -rdynamic 
+     LIB += $(RENDERCHECKGLLIB) ${OPENGLLIB} $(PARAMGLLIB) ${LIB} -ldl -rdynamic 
 else
 # static linking, we will statically link against CUDA and CUDART
   ifeq ($(USEDRVAPI),1)
-     LIB += -lcuda   ${OPENGLLIB} $(PARAMGLLIB) $(RENDERCHECKGLLIB) ${LIB} 
+     LIB += -lcuda   $(RENDERCHECKGLLIB) ${OPENGLLIB} $(PARAMGLLIB) ${LIB} 
   else
      ifeq ($(emu),1) 
          LIB += -lcudartemu
      else 
          LIB += -lcudart
      endif
-     LIB += ${OPENGLLIB} $(PARAMGLLIB) $(RENDERCHECKGLLIB) ${LIB}
+     LIB += $(RENDERCHECKGLLIB) ${OPENGLLIB} $(PARAMGLLIB) ${LIB}
   endif
 endif

其他编译所需依赖的安装

必须依赖安装包

sudo apt-get install g++ freeglut3-dev libxi-dev libxmu-dev

如果你还想用mpi,可以安装openmpi的包

sudo apt-get install openmpi-bin openmpi-dev

编译和测试sdk

cd ~/NVIDIA_GPU_Computing_SDK/C
make

测试

cd ~/NVIDIA_GPU_Computing_SDK/C/bin/linux/release
./nbody

 

P。S。

没看动说的啥,先放这里把。

由于64位系统的原因,如果编译的时候出现错误 “/usr/bin/ld: cannot find -lcutil”,你可以尝试创建链接来修正它 。

cd ~/NVIDIA_GPU_Computing_SDK/C/lib
for i in *_x86_64.a; do ln -sv $i ${i%_x86_64.a}.a; done

 

 

Avatar_small
zhumeng1989 说:
2012年8月15日 00:45

弄了半天,就靠你这个通过了,真是太感谢!

Avatar_small
Top Engineering Cons 说:
2021年1月24日 20:36

Thanks for sharing your thoughts and wisdom about web development. May you find more time in sharing informative posts in the future.

Engineering Consultants in Sharjah

Villa Design in Sharjah

Top Engineering Consultants in UAE 

Avatar_small
hassan 说:
2021年1月28日 22:40

General visits recorded here are the most easy system to esteem your imperativeness, which is the motivation behind why I am taking off to the site conventional, examining for new, interesting information. Many, favor your heart! Area Code 855

Avatar_small
dark web sites 说:
2021年5月20日 00:55

I appreciate your efforts in preparing this post. I really like your blog articles.

Avatar_small
agen baccarat online 说:
2021年6月13日 19:25

The thought of risking your hard earned money is often enough to discourage baccarat players from visiting the tables at a live or online baccarat casino. But the option to play baccarat online for fun changes everything.

Avatar_small
click 说:
2021年7月11日 21:08

I am hoping that you will continue writing this kind of blog. Thanks for sharing this information.

Avatar_small
Click Here 说:
2021年7月12日 19:07

The inherent desire to get more pleasure for little or nothing is the reason why people find gambling so pleasurable.

Avatar_small
BSEB 10th Question P 说:
2021年7月22日 20:15

Bihar School Education Board has released the 10th Question Papers for the year 2022. (BSEB). The question papers from prior years are available in pdf format. Students studying for Inter examinations should practise model or sample papers to gain a sense of <a
href="https://10thmodelquestionpaper.in/bihar-10th-model-paper-bseb-matric-important-question-paper/">BSEB 10th Question Paper 2022</a> the types of questions that will be asked. They will gain familiarity with the marking structure and amount of questions by solving BSEB 12th Question Paper 2022. Furthermore, completing these Question Papers in the allotted time will aid pupils in boosting their problem-solving speed.

Avatar_small
BSEB 10th Question P 说:
2021年7月22日 20:17

Bihar School Education Board has released the 10th Question Papers for the year 2022. (BSEB). The question papers from prior years are available in pdf format. Students studying for Inter examinations should practise model or sample papers to gain a sense of https://10thmodelquestionpaper.in/bihar-10th-model-paper-bseb-matric-important-question-paper/">BSEB 10th Question Paper 2022 the types of questions that will be asked. They will gain familiarity with the marking structure and amount of questions by solving BSEB 12th Question Paper 2022. Furthermore, completing these Question Papers in the allotted time will aid pupils in boosting their problem-solving speed.

Avatar_small
꽁머니 说:
2021年7月29日 18:37

Excellent article. I want to thank you for this informative read; I really appreciate sharing this great post. Keep up your work!

Avatar_small
Umzugsunternehmen Zü 说:
2021年8月10日 19:47

With our age of technology, there are countless ways to market your company and your product or services aside from the traditional business letters and paid space advertisements.

Avatar_small
ครีมซองเซเว่น 说:
2021年8月18日 01:30

I am hoping that you will continue writing this kind of blog. Thanks for sharing this information.

Avatar_small
Lee Roy strain 说:
2021年9月06日 19:58

Hi there! You make so many good points here that I read your article a couple of times. This is really nice content for your readers.

Avatar_small
matka result 说:
2021年10月16日 20:46

Also please do mention your idea and questions in the comment box it will help us to write more engaging and informative article for you.

Avatar_small
matka boss 说:
2021年11月06日 23:17

Hi there! You make so many good points here that I read your article a couple of times. This is really nice content for your readers.

Avatar_small
Delta 8 Area 52 说:
2022年4月15日 22:24

Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic.

Avatar_small
dark web/deep web/d 说:
2022年8月21日 00:55

If you're not careful, you can fall victim to these scams and wind up wasting your time and even money. dark web links

Avatar_small
dark web/deep web/d 说:
2022年8月21日 01:49

Some of the programs and websites offering this service may try to sell you something, even if they aren't really legitimate. deep web

Avatar_small
dark web/deep web/d 说:
2022年8月21日 02:13

And if you don't have a lot of friends on any of these sites to recruit, then you can't expect to make money.  dark web sites

Avatar_small
dark web/deep web/d 说:
2022年8月21日 02:35

So can I make money with links? The answer is yes, you can but it's not easy. It takes time and effort and hence, not many people can do it. dark web links

Avatar_small
dark web/deep web/d 说:
2022年8月21日 02:53

The more links you have, the more visitors you can attract and the more money you can make. However, you need to make sure that you are only working with legitimate companies or individuals.  dark web

Avatar_small
dark web/deep web/d 说:
2022年8月21日 03:12

You will quickly find that there are hundreds of thousands of companies you can join and become an affiliate for. The key is to find the affiliate programs that offer the products or services that appeal to you and then concentrate your efforts on these companies. work from home jobs

Avatar_small
dark web/deep web/d 说:
2022年8月21日 03:28

When you have found an appropriate seller, the next step in your quest for success with affiliate marketing is to set up a simple website that displays the products or services offered by your selected companies. affiliate marketing success

Avatar_small
charlly 说:
2023年1月02日 20:48

"To install CUDA 4.2 on Ubuntu 12.04, you need to first install the NVIDIA CUDA Toolkit. This can be done by running the following command: sudo apt-get install nvidia-cuda-toolkit Once the NVIDIA CUDA Toolkit is installed, you can then proceed to install CUDA 4.2. This can be done by running the following command: sudo apt-get install cuda-4.2 Once CUDA 4.2 is installed, you should be able lupus anticoagulant to run CUDA programs on your Ubuntu 12.04 system. "

Avatar_small
192.168.0.1 说:
2023年2月02日 20:53

Internet is something we all use in our daily life to experience different things from Entertainment in our personal life to getting extensive work done in the office life as well, but in order to do this you might turn to your Internet connection via the Wi-Fi which is only accessible if you have a router that allows to give you Wireless connection. 192.168.0.1 And there are a lot of routers all across the world that use different Internet Protocol Gateways to access the Admin panel and some of these routers use the IP Address 192.168.0.1.

Avatar_small
asdasd 说:
2023年7月23日 21:07

Thank you so much for the post you do. I like your post and all you share with us is up to date and quite informative, i would like to bookmark the page so i can come here again to read you, as you have done a wonderful job. <a href="https://777hokigacor.com/">deposit pulsa tanpa potongan</a>

Avatar_small
asdasd 说:
2023年7月23日 21:08

Thank you so much for the post you do. I like your post and all you share with us is up to date and quite informative, i would like to bookmark the page so i can come here again to read you, as you have done a wonderful job. [url=https://777hokigacor.com/]deposit pulsa tanpa potongan[/url]

Avatar_small
asdasd 说:
2023年7月23日 21:08

Thank you so much for the post you do. I like your post and all you share with us is up to date and quite informative, i would like to bookmark the page so i can come here again to read you, as you have done a wonderful job. deposit pulsa tanpa potongan

Avatar_small
asdasd 说:
2023年7月25日 22:12

It is my first visit to your blog, and I am very impressed with the articles that you serve. Give adequate knowledge for me. Thank you for sharing useful material. I will be back for the more great post. jw8thai

Avatar_small
seo 说:
2023年8月26日 23:37

You there, this is really good post here. Thanks for taking the time to post such valuable information. Quality content is what always gets the visitors coming. <a href="https://www.sharkticket24.com">휴대폰 소액결제 현금화</a>

Avatar_small
seo 说:
2023年8月26日 23:38

You there, this is really good post here. Thanks for taking the time to post such valuable information. Quality content is what always gets the visitors coming. 휴대폰 소액결제 현금화

Avatar_small
seo 说:
2023年8月27日 22:32

Very informative post! There is a lot of information here that can help any business get started with a successful social networking campaign. mccoy marine 50

Avatar_small
asdasd 说:
2023年9月06日 01:07

Scheduling Family Time: In our hectic lives, it's easy to overlook the importance of spending quality time together. Dedicate specific days or times for family activities such as walks, picnics, or game nights. These activities promote bonding and mental well-being. view more

Avatar_small
asdasd 说:
2023年9月12日 01:15

You have beaten yourself this time, and I appreciate you and hopping for some more informative posts in future. Thank you for sharing great information to us. <a href="https://tongbigmoney.com/">피망 머니상</a>

Avatar_small
seo 说:
2023年9月12日 01:52

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. ハロウィーン 仮装

Avatar_small
seo 说:
2023年9月17日 02:29

Wow, cool post. I’d like to write like this too – taking time and real hard work to make a great article… but I put things off too much and never seem to get started. Thanks though. エイジングケア化粧品

Avatar_small
seo 说:
2023年9月27日 00:29

Great job for publishing such a beneficial web site. Your web log isn’t only useful but it is additionally really creative too. hotel lago di garda

Avatar_small
steroids for sale us 说:
2023年11月21日 23:47 Thanks for taking the time to discuss that, I feel strongly about this and so really like getting to know more on this kind of field. Do you mind updating your blog post with additional insight? It should be really useful for all of us. steroids for sale
Avatar_small
myeclasd 说:
2023年11月30日 07:00
The lively and informative website myeclasd, which is devoted to technology, is a great place to stay up to date on the latest developments in the quickly evolving field of technology. with a focus on innovative research, teaching, and learning.
Avatar_small
dshdsd 说:
2023年12月05日 05:22 You have done a great job on this article. It’s very readable and highly intelligent. You have even managed to make it understandable and easy to read. You have some real writing talent. Thank you. UFABETเว็บแทงบอลดีสุด
Avatar_small
aaa 说:
2023年12月11日 00:12

Bid farewell to sports betting scams with Toto Attack! Navigate scam sites with confidence using our guides. Trust our recommendations for verified Toto sites, ensuring a secure betting experience. Encounter scams on our endorsed platforms? We'll compensate you fully. Choose Toto Attack for peace of mind in your sports betting journey! 검증업체

Avatar_small
aaa 说:
2023年12月11日 00:19

Looking for a reliable concrete contractor in Ypsilanti, MI? Choose GatlinByrd Cement. With a decade of experience, our licensed and insured team is committed to delivering quality work for both residential and commercial projects. Trust us for all your cement needs..Concrete contractor

Avatar_small
Imamia Quran Academy 说:
2024年1月09日 09:42

Online Shia Quran Academy is an institute for Quran Education. They have trained teaching staff along with renowned Islamic Scholars for a better understanding of the Quran. Shia Quran Academy is an Online Ahle Tashi Institute that has all the features of traditional madrasahs including the teaching of an authentic understanding of the Quran. Additionally, Shia Quran Academy Online provides all teaching by certified professional teachers. Thus, joining Quran Academy will be suitable and beneficial for every learner. It is very difficult to find a good Online Shia Quran Center with Shia Teachers abroad except in Muslim or especially Ahle Tashi majority countries. Imamia Quran Center connects students virtually from all over the world including countries with less or no Ahle Tashi population or Shia Quran Centers. Our Quran Academy is a comprehensive institution with full fledged facilities regarding Shia Quran Learning. Ahle Tashi Quran student is free to choose the timings of classes, lecturers and tutors according to their feasibility and availability to Learn Shia Quran. Online learning more efficiently saves time and money spent over conveyance and physical going to any conventional Shia Quran Institute. Online Shia Madrasa selects highly qualified Quran teachers, keeping in mind the ages of kids and adults, who teach kids and adults Quranic education as well as their beliefs, spirituality and worldly life. The Shia Quran Madrasa Online is a secure place for kids and adults to learn and memorize the Quran. They teach the translation and interpretation of the Holy Quran under the guidance of expert Quranic teachers. Our Shia Quran Madrasa is second to none in providing education to Ahle Tashi women’s. So our center has selected Ahle Tashi Female Quran teacher with higher education from Madrasas. Online Shia Quran Madrasa is one of the best academies providing its services all over the world including USA, UK, Canada, Germany, France and Australia.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter
Host by is-Programmer.com | Power by Chito 1.3.3 beta | © 2007 LinuxGem | Design by Matthew "Agent Spork" McGee