# CL\_INVALID\_OPERATION on clEnqueueAcquireGLObjects

**URL:** <https://forums.developer.nvidia.com/t/cl-invalid-operation-on-clenqueueacquireglobjects/250417>\
**Category:** Linux\
**Tags:** opencl\
**Created:** [April 19, 2023, 1:26am UTC](https://forums.developer.nvidia.com/t/cl-invalid-operation-on-clenqueueacquireglobjects/250417 "2023-04-19T01:26:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dr.elichan1](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/dr.elichan1/32/245674_2.png) [@dr.elichan1](https://forums.developer.nvidia.com/u/dr.elichan1)\
**Post date:** [April 19, 2023, 1:26am UTC](https://forums.developer.nvidia.com/t/cl-invalid-operation-on-clenqueueacquireglobjects/250417/1 "2023-04-19T01:26:49Z")

</div>

I downloaded the “OpenCL Marching Cubes Isosurfaces” example from “[Open Computing Language OpenCL | NVIDIA Developer](http://developer.nvidia.com/opencl)” and managed to compile it. However, it executes with the following error:

```auto
!!! Error # -59 (CL_INVALID_OPERATION) at line 863 , in file oclMarchingCubes.cpp !!!

```

I speculate that it is opencl failed to acquire PBO for writing

```auto
ciErrNum = clEnqueueAcquireGLObjects(cqCommandQueue, 2, interopBuffers, 0, 0, 0);

```

However, how to fix it?

Below is thhe screen output:

```auto
 ...loading Scan.cl
 ...creating scan program
 ...building scan program
 ...creating scan kernels
 ...checking minimum supported workgroup size
 ...allocating internal buffers
grid: 32 x 32 x 32 = 32768 voxels
max verts = 102400
Read './src/oclMarchingCubes/data/Bucky.raw', 32768 bytes

 !!! Error # -59 (CL_INVALID_OPERATION) at line 863 , in file oclMarchingCubes.cpp !!!

[oclMarchingCubes] test results...
FAILED
> exiting in 3 seconds: 3...2...1...done!

bin/linux/release/oclMarchingCubes Exiting...
Press <Enter> to Quit
----------------------

```
