- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In Past solutions ,This method cannot be used anymore because there is no clang compiler.
clang ocl_vecadd.c -o ocl_vecadd -lOpenCL -lm -I/opt/intel/inteloneapi/compiler/latest/linux/include/sycl/ && ./ocl_vecadd
I have tried to replace clang with icpx, but I cannot obtain the result. The following error is reported:
/usr/bin/ld: /tmp/icpx-b9b022/gpu_sample-4f1f6b.o: in function `main':
gpu_sample.cpp:(.text+0xc9): undefined reference to `clGetPlatformIDs'
/usr/bin/ld: gpu_sample.cpp:(.text+0xea): undefined reference to `clGetPlatformIDs'
/usr/bin/ld: gpu_sample.cpp:(.text+0x109): undefined reference to `clGetDeviceIDs'
/usr/bin/ld: gpu_sample.cpp:(.text+0x139): undefined reference to `clGetDeviceIDs'
/usr/bin/ld: gpu_sample.cpp:(.text+0x15d): undefined reference to `clCreateContext'
/usr/bin/ld: gpu_sample.cpp:(.text+0x171): undefined reference to `clCreateCommandQueue'
/usr/bin/ld: gpu_sample.cpp:(.text+0x18b): undefined reference to `clCreateBuffer'
/usr/bin/ld: gpu_sample.cpp:(.text+0x1ac): undefined reference to `clCreateBuffer'
/usr/bin/ld: gpu_sample.cpp:(.text+0x1d5): undefined reference to `clCreateBuffer'
/usr/bin/ld: gpu_sample.cpp:(.text+0x208): undefined reference to `clEnqueueWriteBuffer'
/usr/bin/ld: gpu_sample.cpp:(.text+0x235): undefined reference to `clEnqueueWriteBuffer'
/usr/bin/ld: gpu_sample.cpp:(.text+0x25a): undefined reference to `clCreateProgramWithSource'
/usr/bin/ld: gpu_sample.cpp:(.text+0x276): undefined reference to `clBuildProgram'
/usr/bin/ld: gpu_sample.cpp:(.text+0x28f): undefined reference to `clCreateKernel'
/usr/bin/ld: gpu_sample.cpp:(.text+0x2a6): undefined reference to `clSetKernelArg'
/usr/bin/ld: gpu_sample.cpp:(.text+0x2c1): undefined reference to `clSetKernelArg'
/usr/bin/ld: gpu_sample.cpp:(.text+0x2dc): undefined reference to `clSetKernelArg'
/usr/bin/ld: gpu_sample.cpp:(.text+0x317): undefined reference to `clEnqueueNDRangeKernel'
/usr/bin/ld: gpu_sample.cpp:(.text+0x347): undefined reference to `clEnqueueReadBuffer'
/usr/bin/ld: gpu_sample.cpp:(.text+0x383): undefined reference to `clReleaseKernel'
/usr/bin/ld: gpu_sample.cpp:(.text+0x38d): undefined reference to `clReleaseProgram'
/usr/bin/ld: gpu_sample.cpp:(.text+0x395): undefined reference to `clReleaseCommandQueue'
/usr/bin/ld: gpu_sample.cpp:(.text+0x39f): undefined reference to `clReleaseMemObject'
/usr/bin/ld: gpu_sample.cpp:(.text+0x3a9): undefined reference to `clReleaseMemObject'
/usr/bin/ld: gpu_sample.cpp:(.text+0x3b3): undefined reference to `clReleaseMemObject'
/usr/bin/ld: gpu_sample.cpp:(.text+0x3bd): undefined reference to `clReleaseContext'
icpx: error: linker command failed with exit code 1 (use -v to see invocation)
Is there any way to run it now or is it not supported?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thank you for posting in Intel Communities. We could run a OpenCL sample with the below command in oneAPI command in node-s019-n011.
icpx -I/opt/intel/oneapi/compiler/latest/linux/include/sycl -lOpenCL openclsample.c
However, we are not able to run the binary executable and would end up with segmentation fault error. Please let us know you've observed the same.
If the above command doesn't work for you, we would like to look at your OpenCL sample code. Could you please share it?
Please accept this as a solution if this helps resolving your issue. This helps others with similar issue. Thank you!
Regards,
Alekhya
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thank you for posting in Intel Communities. We could run a OpenCL sample with the below command in oneAPI command in node-s019-n011.
icpx -I/opt/intel/oneapi/compiler/latest/linux/include/sycl -lOpenCL openclsample.c
However, we are not able to run the binary executable and would end up with segmentation fault error. Please let us know you've observed the same.
If the above command doesn't work for you, we would like to look at your OpenCL sample code. Could you please share it?
Please accept this as a solution if this helps resolving your issue. This helps others with similar issue. Thank you!
Regards,
Alekhya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Has the solution provided helped? Could you please give us an update regarding this issue?
Regards,
Alekhya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you. This method is very effective. In addition, replacing dpcpp with the above command 'clang' also has the same effect。
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Glad to know that your issue is resolved. Thank you for accepting our solution. If you need any further assistance, please post a new question as this thread will no longer be monitored by Intel.
Regards,
Alekhya
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page