I think the -30 error code is most likely intended to be interpreted the same way you would interpret any OpenCL error code, i.e. the same way you would interpret the error as if it were returned by clCreateBuffer. That is -30 = INVALID_VALUE. No, I’m not able to tell you precisely what that means, or what argument it is referring to, as I am unable to duplicate your error.
The following code appears to work correctly for me (throws no errors):
$ cat t1.cpp
#include <CL/opencl.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
cl_platform_id platform;
cl_device_id device;
cl_context context;
cl_mem mem1[1];
cl_int err;
err = clGetPlatformIDs(1, &platform, NULL);
if (err != CL_SUCCESS) {printf("%d: %d\n", __LINE__, err); return -1;}
err = clGetDeviceIDs(platform, CL_DEVICE_TYPE_ALL, 1, &device, NULL);
if (err != CL_SUCCESS) {printf("%d: %d\n", __LINE__, err); return -1;}
context = clCreateContext(NULL, 1, &device, NULL, NULL, &err);
if (err != CL_SUCCESS) {printf("%d: %d\n", __LINE__, err); return -1;}
size_t mem_size = 0x20000000; // 512MB
int i = 0;
cl_mem (*clCreateBufferNV)(cl_context,cl_mem_flags, cl_mem_flags_NV, size_t, void*, cl_int*) = (cl_mem (*)(cl_context,cl_mem_flags, cl_mem_flags_NV, size_t, void*, cl_int*)) clGetExtensionFunctionAddress("clCreateBufferNV");
if (clCreateBufferNV == NULL) {printf("invalid function pointer request\n"); return -1;}
mem1[i] = clCreateBufferNV(context, CL_MEM_READ_WRITE , CL_MEM_PINNED_NV, (size_t)mem_size, NULL, &err);
if (err != CL_SUCCESS) {printf("%d: %d\n", __LINE__, err); return -1;}
}
$ nvcc -o t1 t1.cpp -lOpenCL
t1.cpp: In function ‘int main(int, char**)’:
t1.cpp:19:177: warning: ‘void* clGetExtensionFunctionAddress(const char*)’ is deprecated [-Wdeprecated-declarations]
m_flags, cl_mem_flags_NV, size_t, void*, cl_int*) = (cl_mem (*)(cl_context,cl_mem_flags, cl_mem_flags_NV, size_t, void*, cl_int*)) clGetExtens
^
In file included from /usr/local/cuda-10.0/bin/..//include/CL/opencl.h:42:0,
from t1.cpp:1:
/usr/local/cuda-10.0/bin/..//include/CL/cl.h:1228:1: note: declared here
clGetExtensionFunctionAddress(const char * /* func_name */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
^
t1.cpp:19:177: warning: ‘void* clGetExtensionFunctionAddress(const char*)’ is deprecated [-Wdeprecated-declarations]
m_flags, cl_mem_flags_NV, size_t, void*, cl_int*) = (cl_mem (*)(cl_context,cl_mem_flags, cl_mem_flags_NV, size_t, void*, cl_int*)) clGetExtens
^
In file included from /usr/local/cuda-10.0/bin/..//include/CL/opencl.h:42:0,
from t1.cpp:1:
/usr/local/cuda-10.0/bin/..//include/CL/cl.h:1228:1: note: declared here
clGetExtensionFunctionAddress(const char * /* func_name */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
^
t1.cpp:19:225: warning: ‘void* clGetExtensionFunctionAddress(const char*)’ is deprecated [-Wdeprecated-declarations]
, cl_int*) = (cl_mem (*)(cl_context,cl_mem_flags, cl_mem_flags_NV, size_t, void*, cl_int*)) clGetExtensionFunctionAddress("clCreateBufferNV");
^
In file included from /usr/local/cuda-10.0/bin/..//include/CL/opencl.h:42:0,
from t1.cpp:1:
/usr/local/cuda-10.0/bin/..//include/CL/cl.h:1228:1: note: declared here
clGetExtensionFunctionAddress(const char * /* func_name */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
^
$ ./t1
$
The test case here is Ubuntu 16.04, CUDA 10.0, driver 418.40.04, Tesla V100
You may wish to try a newer GPU driver on your setup. I don’t have a convenient setup with driver version 384.111 to test, and I’m not able to find out whether that driver supports this capability. Since the GTC slides you linked say the functionality will be available in production in and after Q2 2018, and the R384 driver branch predates that, I wouldn’t be surprised if the functionality wasn’t checked into R384. At least, I wouldn’t expect it to be in 384.111 based on that note. 384.111 was released on January 4, 2018:
https://www.nvidia.com/download/driverResults.aspx/128737/en-us
I also won’t be able to tell you which drivers have this functionality and which don’t. I suggest you use a recent driver for your GPU. That’s good practice in general, and its also generally helpful to test on the latest driver when you are having an issue. Things get fixed all the time.
I also understand you may be using a university or other facility research cluster for which updating the GPU driver is not a trivial matter or under your direct control. However, 384.111 is quite old, and hopefully (if that is the case) you can get your IT staff to update the driver.