Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

LXF173 CUDA article

Post new topic   Reply to topic    Linux Format forums Forum Index -> Magazine and coverdiscs
View previous topic :: View next topic  
Author Message

Joined: Sat Jun 22, 2013 8:45 pm
Posts: 1

PostPosted: Mon Jun 24, 2013 1:33 pm    Post subject: LXF173 CUDA article Reply with quote

Hello all,
Despite having been a Linux user now for several years, and a magazine subscriber for about two years, this is my first post! (I did have some problems with a previous username not being activated several months ago, so set up another one).
I thought I would put my old 8800GTS graphics card to work properly, having heard of CUDA before, so was very interested in following Ben Everard's tutorial. Although I like to read through all the code examples properly first, it is very useful having the files available on the coverdisk. I had a number of problems following all the steps in the article though.
Firstly, I never was able to locate the test script '' referred to on p.80. This wasn't too important, as I got the next two examples to run correctly, but it did confuse me somewhat.
The trouble really started though when I tried to install pyCuda. I run several distros, including an old Ubuntu version (10.04) and Linux Mint 13 (based on Ubuntu 11.10 I believe), so I thought I'd try it on both and see what happened. I should mention that both of these are 32-bit, and I made sure to use the relevant files in the examples! Sure enough, as mentioned in the text, pyCuda was not in the package archives of either distro, so I had to install by hand, using the link provided -
Having had some dependency problems in the past with Lucid, I wasn't hopeful, and indeed nothing seemed to work, from either the generic installation instructions or the Lucid-specific ones, producing various errors and warnings about files not being found, although I did manage to get further down the line with Mint.
While waiting for my account here to be approved, I did some more investigation, and finally came across this info:
Following the instructions carefully, I managed to get a successful pyCuda installation on Mint 13 (with the proviso that Mint's window manager is mdm rather than lightdm of course).
What it didn't say in the text, and what isn't obvious from some articles online, is that the procedure involves downloading the *entire* CUDA toolkit from the Nvidia website, version 5 of which is over 500MB in size! I know there are older versions available which are less weighty, but if someone has managed to get pyCuda working without the toolkit I would be very interested to know, as I could not find a way.
The other problem I encountered was running the optimized C-code on p.82/3. Using the values specified in the text (and provided in the coverdisk files) the step was failing with the following:
Traceback (most recent call last):
  File "", line 53, in <module>
    block=(1000,1,1), grid=(10000,1,1))
  File "/usr/local/lib/python2.7/dist-packages/pycuda-2012.1-py2.7-linux-i686.egg/pycuda/", line 354, in function_call
pycuda._driver.LogicError: cuFuncSetBlockShape failed: invalid value

Having tweaked the block and grid parameters, I discovered that I was using a block size which was not supported by the card - the 8800GTS only has 512 blocks. The error message was somewhat cryptic, and I think the text should have mentioned the likely result of using invalid parameters on p.83.
Particularly useful would have been a method for determining the max values for your graphics card. With the full CUDA toolkit installation, there is a file deviceQuery
(usually located in ~/NVIDIA_CUDA-5.0_Samples/bin/linux/) which shows all the relevant values, but even a link to a site with the specs of various cards would have been useful.....
As this is my first post, 'apologies for length' and any other errors, and I hope someone else finds the information here useful - it took me several hours of head scratching to obtain Wink
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Magazine and coverdiscs All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 

Powered by phpBB © 2001, 2005 phpBB Group

Copyright 2011 Future Publishing, all rights reserved.

Web hosting by UKFast