I'm trying to implement a neuron model with Hodgkin and Huxley formalism on my RTX 2080 Ti with PyCuda.
The code is quite large so I wont put all of it here.
the first part of my class is to set the number of neurons, create all variables in the GPU and get the block and grid size according on the number of neurons (1 neuron by thread)
Traceback (most recent call last):
File "C:/Users/maxime/Desktop/SESAME/PycharmProjects/Modele_Micro3/Class_PyrCell_GPU.py", line 1668, in <module>
Vm = PC.rk4_Time(30000)
File "C:/Users/maxime/Desktop/SESAME/PycharmProjects/Modele_Micro3/Class_PyrCell_GPU.py", line 1637, in rk4_Time
self.updateParameters()
File "C:/Users/maxime/Desktop/SESAME/PycharmProjects/Modele_Micro3/Class_PyrCell_GPU.py", line 998, in updateParameters
func = self.mod.get_function("h_inf_PC")
File "C:\Python389\lib\site-packages\pycuda\compiler.py", line 326, in get_function
return self.module.get_function(name)
pycuda._driver.LogicError: cuModuleGetFunction failed: an illegal memory access was encountered
PyCUDA WARNING: a clean-up operation failed (dead context maybe?)
cuMemFree failed: an illegal memory access was encountered
What I'm not understanding is that the error does not occur the first time I use the kernel h_inf_PC, it happens on the 13th line of the function setParameters but I already calling the same kernel in line 5 of the same function. If I comment out the calling to the kernel (h_inf_PC) that causes the issue, the error switched on another calling to a kernel but not necessarily the next one.
I'm trying to implement a neuron model with Hodgkin and Huxley formalism on my RTX 2080 Ti with PyCuda. The code is quite large so I wont put all of it here. the first part of my class is to set the number of neurons, create all variables in the GPU and get the block and grid size according on the number of neurons (1 neuron by thread)
In the function
init_vector
andinit_vector_param
, I put vectors to compute ODE results in the GPUIn the function
Create_GPU_SourceModule
, I create kernels to use on the GPU.I have the a function to update all my variables in a RK4 solver
updateParameters
When I run the code I get this error:
What I'm not understanding is that the error does not occur the first time I use the kernel
h_inf_PC
, it happens on the 13th line of the functionsetParameters
but I already calling the same kernel in line 5 of the same function. If I comment out the calling to the kernel (h_inf_PC
) that causes the issue, the error switched on another calling to a kernel but not necessarily the next one.