pycuda

CUDA 9.0 and pycuda, error:CompileError: nvcc compilation … kernel.cu failed

瘦欲@ 提交于 2020-01-23 14:54:32
问题 import pycuda.driver as cuda import pycuda.autoinit from pycuda.compiler import SourceModule import numpy a = numpy.random.randn(4,4) a = a.astype(numpy.float32) a_gpu = cuda.mem_alloc(a.nbytes) cuda.memcpy_htod(a_gpu, a) mod = SourceModule(""" __global__ void doublify(float *a) { int idx = threadIdx.x + threadIdx.y*4; a[idx] *= 2; } """) I just installed CUDA 9.0 and pycuda, and I am following the tutorial to run the first cuda program. But it always turns out error: CompileError: nvcc

CUDA 9.0 and pycuda, error:CompileError: nvcc compilation … kernel.cu failed

对着背影说爱祢 提交于 2020-01-23 14:53:39
问题 import pycuda.driver as cuda import pycuda.autoinit from pycuda.compiler import SourceModule import numpy a = numpy.random.randn(4,4) a = a.astype(numpy.float32) a_gpu = cuda.mem_alloc(a.nbytes) cuda.memcpy_htod(a_gpu, a) mod = SourceModule(""" __global__ void doublify(float *a) { int idx = threadIdx.x + threadIdx.y*4; a[idx] *= 2; } """) I just installed CUDA 9.0 and pycuda, and I am following the tutorial to run the first cuda program. But it always turns out error: CompileError: nvcc

pycuda fail; Theano with Anaconda

流过昼夜 提交于 2020-01-23 12:25:46
问题 I'm using Anaconda to install Theano on MacOSX (Mavericks 10.9 ), just like this post explains: "How to make Theano operate on Mac Lion?" theano.test() This command gives the same error as in the post above. It gives that error on an Ubuntu 14.1, System 76 as well. I am able to import commands from Theano; but I still would like to understand why theano.test() fails. The packages CUDA and Boost were already installed before running... (Reference: See section: " Testing your Installation "

pyCUDA with Flask gives pycuda._driver.LogicError: cuModuleLoadDataEx

核能气质少年 提交于 2020-01-14 07:23:07
问题 I want to run a pyCUDA code on a flask server. The file runs correctly directly using python3 but fails when the corresponding function is called using flask . Here is the relevant code: cudaFlask.py: import pycuda.autoinit import pycuda.driver as drv import numpy from pycuda.compiler import SourceModule def cudaTest(): mod = SourceModule(""" int x = 4; """) print ("done") return if __name__ == "__main__": cudaTest() server.py (only the part which calls the function): @app.route('/bundle',

driver.Context.synchronize()- what else to take into consideration — -a clean-up operation failed

最后都变了- 提交于 2020-01-13 10:45:12
问题 I have this code here (modified due to the answer). Info 32 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads ptxas info : Used 46 registers, 120 bytes cmem[0], 176 bytes cmem[2], 76 bytes cmem[16] I don't know what else to take into consideration in order to make it work for different combinations of points "numPointsRs" and "numPointsRp" When ,for example, i run the code with Rs=10000 and Rp=100000 with block=(128,1,1),grid=(200,1) its fine. My computations: 46 registers

How to perform PyCUDA 4x4 matrix inversion with same accuracy than numpy linalg “inv” or “pinv” function

試著忘記壹切 提交于 2020-01-07 09:36:00
问题 I am facing an issue of accuracy about my code which performs a number (128, 256, 512) of 4x4 matrix inversions. When I use the original version, i.e the numpy function np.linalg.inv or np.linalg.pinv , everything works fine. Unfortunately, with the CUDA code below, I get nan and inf values into inverted matrix. To be more explicit, I take this matrix to invert : 2.120771107884677649e+09 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 3

cuda, pycuda — how to write complex numbers — errors:class “cuComplex” has no member “i”

柔情痞子 提交于 2020-01-06 14:52:11
问题 I have difficulties to use complex numbers in cuda,pycuda. I have this in C: #include <complex> typedef std::complex<double> cmplx; .... cmplx j(0.,1.); Also,in the same code: #include <boost/python.hpp> #include <boost/array.hpp> ... typedef std::vector< boost::array<std::complex<double>,3 > > ComplexFieldType; typedef std::vector< boost::array<double,3> > RealFieldType; ... __global__ void compute(RealFieldType const & Rs,ComplexFieldType const & M,..) ... How can i convert this to use it

pycuda ImportError in pycuda.driver

北慕城南 提交于 2020-01-03 12:35:31
问题 I'm trying to compile some sources for working with my GPU. I use pycuda for this. When I compile source code, I receive some errors from Python: C:\Users\Dmitriy\wcm>python ws_gpu.py test.dcm Traceback (most recent call last): File "ws_gpu.py", line 2, in <module> import pycuda.gpuarray as gpu File "C:\Python27\lib\site-packages\pycuda\gpuarray.py", line 3, in <module> import pycuda.elementwise as elementwise File "C:\Python27\lib\site-packages\pycuda\elementwise.py", line 33, in <module>

cuda — out of memory (threads and blocks issue) --Address is out of bounds

别说谁变了你拦得住时间么 提交于 2019-12-31 05:26:26
问题 I am using 63 registers/thread ,so (32768 is maximum) i can use about 520 threads.I am using now 512 threads in this example. (The parallelism is in the function "computeEvec" inside global computeEHfields function function.) The problems are: 1) The mem check error below. 2) When i use numPointsRp>2000 it show me "out of memory" ,but (if i am not doing wrong) i compute the global memory and it's ok. -------------------------------UPDATED--------------------------- i run the program with cuda

pycuda — 'CUDA_ROOT not set, and nvcc not in path.'

让人想犯罪 __ 提交于 2019-12-29 08:33:07
问题 Although i had installed pycuda and using it ok,it started (without doing sth) not to work.So,i i tried to do the install again ,but when i am doing python configure.py --cuda-root=/usr/local/cuda/bin it gives me the error in the title. The nvcc file is in the above directory. 回答1: pycuda is not finding nvcc. Did you try adding /usr/local/cuda/bin to your env PATH variable? That's the way I have this setup. Edit: As far as I can tell the configure.py doesn't call nvcc compiler it just creates