pycuda

Probleme bei der Installation?
Antworten
skidzo
User
Beiträge: 2
Registriert: Montag 18. April 2011, 18:10

Hi there , first time writing here in this forum. Und ich habe bemerkt das dies ein deutsches Forum ist, dennoch schreibe ich diesen Post in englischer Sprache.

I just installed cudatoolkit_4.0.13_linux_64_ubuntu10.10.run and NVIDIA_CUDA_SDK_2.02.0807.1535_linux.run on my linux machine Linux-x86_64 with the nvidia driver version 260.19.06 installed.

I compiled and installed pycuda-0.94.2 successfully (there where no errors) my graphic card is a NVIDIA Quadro 4000.

now trying to import something from pycuda like:

Code: Alles auswählen

import pycuda.driver as cuda
import pycuda.autoinit
I get:
Traceback (most recent call last):
File "/home/jeckstein/Dokumente/pycuda/autoinit.py", line 1, in <module>
import pycuda.driver as cuda
File "/usr/local/lib/python2.6/dist-packages/pycuda-0.94.2-py2.6-linux-x86_64.egg/pycuda/driver.py", line 1, in <module>
from pycuda._driver import *
ImportError: /usr/local/lib/python2.6/dist-packages/pycuda-0.94.2-py2.6-linux-x86_64.egg/pycuda/_driver.so: undefined symbol: cuCtxPushCurrent_v2
SOLVED: wrong cudatoolkit version
Zuletzt geändert von skidzo am Dienstag 19. April 2011, 08:20, insgesamt 1-mal geändert.
skidzo
User
Beiträge: 2
Registriert: Montag 18. April 2011, 18:10

Just found out that I was using the latest cudatoolkit and this happend to be incompatible with the latest available pycuda module.

With cudatoolkit_3.2.16_linux_64_ubuntu10.04 i have no problems so far...

I think my real problem starts with the nvidia driver, as I think the normal proprietary driver is not enough...

trying something from the examples like:

Code: Alles auswählen

import pycuda.autoinit
import pycuda.driver as drv
import numpy

from pycuda.compiler import SourceModule
mod = SourceModule("""
__global__ void multiply_them(float *dest, float *a, float *b)
{
  const int i = threadIdx.x;
  dest[i] = a[i] * b[i];
}
""")

multiply_them = mod.get_function("multiply_them")

a = numpy.random.randn(400).astype(numpy.float32)
b = numpy.random.randn(400).astype(numpy.float32)

dest = numpy.zeros_like(a)
multiply_them(
        drv.Out(dest), drv.In(a), drv.In(b),
        block=(400,1,1), grid=(1,1))

print dest-a*b
Gives:

Traceback (most recent call last):
File "/home/jeckstein/Dokumente/pycuda/autoinit.py", line 17, in <module>
""")
File "/usr/local/lib/python2.6/dist-packages/pycuda-0.94.2-py2.6-linux-x86_64.egg/pycuda/compiler.py", line 238, in __init__
arch, code, cache_dir, include_dirs)
File "/usr/local/lib/python2.6/dist-packages/pycuda-0.94.2-py2.6-linux-x86_64.egg/pycuda/compiler.py", line 228, in compile
return compile_plain(source, options, keep, nvcc, cache_dir)
File "/usr/local/lib/python2.6/dist-packages/pycuda-0.94.2-py2.6-linux-x86_64.egg/pycuda/compiler.py", line 47, in compile_plain
checksum.update(get_nvcc_version(nvcc))
File "<string>", line 2, in get_nvcc_version
File "/usr/local/lib/python2.6/dist-packages/pytools-2011.3-py2.6.egg/pytools/__init__.py", line 309, in memoize
result = func(*args)
File "/usr/local/lib/python2.6/dist-packages/pycuda-0.94.2-py2.6-linux-x86_64.egg/pycuda/compiler.py", line 21, in get_nvcc_version
% (nvcc, str(e)))
OSError: nvcc was not found (is it on the PATH?) [error invoking 'nvcc --version': [Errno 2] No such file or directory]
Script terminated.

the PATH is correctly set and also the LD_LIBRARY_PATH and i also tried the PYTHONPATH to set for the location of nvcc...

I have no Idea now where to go, please help anyone?

SOLVED: in Ubuntu 10.10 the default python is of version 2.6.6, after installing 2.7 it works now...
Antworten