Jetson AGX Orin: Error running pycuda

I am trying to run the following program on NVIDIA AGX Orin, Ubuntu 20.04:

import NumPy
import pycuda.autoinit
import pycuda.driver as drive
from pycuda.compiler import SourceModule

SourceModule compiles C code for CUDA

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)

Perform the computation

multiply_them( drive.Out(dest), drive.In(a), drive.In(b), block=(400,1,1), grid=(1,1))

However, I am getting an error as shown below:


How do you install pyCUDA?
Do you use pip3 install pycuda --user?


Yes, I used pip3 install pycuda --user


Could you share a reproducible source and steps so we can give it a try?
More, does the same app work on other environments like an x86 desktop?


Thank you for your reply.
I was trying to run the attached Python script, using the following command:
myGPUTest.txt (630 Bytes)
I didn’t test on x86 desktop.
I have connected the NVIDIA AGX Orin directly to a monitor, and trying to run this pyCUDA program.


Could you help to check the format of the reproducible source?
We tried to run the source but failed in some format error rather than reproducing the issue.

pycuda.driver.CompileError: nvcc compilation of /tmp/tmpvqci04d2/ failed
[command: nvcc --cubin -arch sm_87 -I/home/nvidia/.local/lib/python3.8/site-packages/pycuda/cuda]
[stderr: error: this declaration has no storage class or type specifier error: expected a ";" warning: parsing restarts here after previous syntax error

2 errors detected in the compilation of "".


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.