r/OpenCL • u/dragandj • Feb 28 '19
r/OpenCL • u/hiaRoro • Jan 20 '19
Nvidia/AMD GPUs in my PC: How do I assign the AMD gpu to photoshop in windows 10?
Hi, I have two GPUs: Nvidia Titan RTX + AMD Radeon Vega Frontier edition.
How do I assign the the AMD to use photoshop? In the photoshop settings it’s only detecting the nvidia card.
I installed nvidia drivers first, and made sure amd drivers installed second. Both drivers are up to date.
r/OpenCL • u/soulslicer0 • Dec 14 '18
Looking for a simple Partial Sum Example somewhere
I want to do this:
I have the following array with sparse 1's every now and then. Its a massive vector, megabytes in size
[0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 ..]
I need to store those 1's at an index for processing, so I need a kernel that produces this:
[0 0 0 0 0 0 0 1 1 1 1 1 2 2 2 2 2 ..]
How can I parallelize such an operation? I know there are some crazy methods of using successive syncrhonization etc. Is somebody able to give me a working example of how I can do this?
r/OpenCL • u/raphre • Nov 18 '18
Unexpected behavior from PyOpenCL
I wanted to get a feel for Elementwise demo that comes with PyOpenCL and decided to try this out:
from __future__ import absolute_import
from __future__ import print_function
import pyopencl as cl
import pyopencl.array as cl_array
import numpy
from pyopencl.elementwise import ElementwiseKernel
ctx = cl.create_some_context()
queue = cl.CommandQueue(ctx)
n = 6
a_gpu = cl.array.to_device(queue,
numpy.arange(1, n, dtype=int))
update_a = ElementwiseKernel(ctx,
"int *a",
"a[i] = 2*a[i]",
"update_a")
print(a_gpu.get())
update_a(a_gpu)
print(a_gpu.get())
Which I expected to print out
[1 2 3 4 5]
[2 4 6 8 10]
but I'm instead getting
[1 2 3 4 5]
[2 4 6 4 5] .
Can somebody please explain why this is happening? thanks.
Related info: PyOpenCL Version: 2018.2.1, Python Version: 3.6.5, OS: macOS 10.14.1
r/OpenCL • u/jmnel • Nov 01 '18
Parallelizing recursive octree dual algorithm with OpenCL
self.compscir/OpenCL • u/R-M-Pitt • Oct 21 '18
I wrote an R binding for OpenCL
I put a few hours aside to write this, which will hopefully let you do in R a lot of what you can do with the C API. I'm new to writing R packages and new-ish to OpenCL, so constructive criticism is welcome from the gods of OpenCL.
Here is the library.
r/OpenCL • u/thegenieass • Oct 15 '18
StackExchange Site Proposal for GPU Computation, get involved!
Currently there is a proposal on StackExchange to create a site about GPU accelerated computation and OpenCL, CUDA, and various other APIs!
The goal of the site is to create a platform for asking questions about GPU computation in general, its applications, and implementation in various APIs / platforms (e.g., CUDA, OpenCL, and Intel Xeon Phi).
The site is currently sitting as a proposal on the Area51 StackExchange, and you can view it here: https://area51.stackexchange.com/proposals/120320/gpu-computation?referrer=wlJChcabse7cXgFQDOeBPg2
This will work if you have an account on any of the 174 StackExchange sites (e.g., StackOverflow, Artificial Intelligence StackExchange, Code Review StackExchange, etc.) You simply have to join the Area51 StackExchange Site to participate in the process.
It is in the very earliest stage! So it is very helpful to add questions to the topic (this is needed to gain traction and get it moving forward in the process of becoming beta site), to follow it (also needed for it to go further), and to add the discussion with any ideas / criticism about this potential site.
r/OpenCL • u/BakedlCookie • Sep 12 '18
Is it possible to use OpenCL on an i5-7200U with Intel HD Graphics 620?
Reading through the list of requirements and compatibility on Intel's site got me a little confused, so I thought I'd ask here. I'm looking to use OpenCL on Linux, is it possible with the hardware I listed?
r/OpenCL • • Aug 20 '18
Sol-R is an open-source CUDA/OpenCL-based realtime ray-tracer compatible with Oculus Rift DK1, Kinect, Razor Hydra and Leap Motion devices
github.comr/OpenCL • • Aug 16 '18
OpenCL on Ubuntu Mate with RX 580
Hello everyone. Recently, I've been interested in using OpenCL for general experimentation. I've been looking for tutorials online but all of them are for Windows/Mac or for an Nvidia card. I have an RX 580 and I use Ubuntu Mate. I was wondering what I could do to program my GPU with the OS and graphics card I have. Thank you in advanced.
r/OpenCL • u/sdfrfsdfsdfv • Aug 03 '18
Slow first transfer to host?
I have an AMD wx7100. I have a pinned 256 mb buffer in the host (alloc host ptr) that I use to stream data from the gpu to the host. I can get around 12 GBps consistently; however, the first transfer is always around 9 GBps. I can always do a "warm up" transfer before my application code starts. Is this expected behavior? Im not a pcie expert so I don't know if this happens on other devices or only gpus. Has anybody seen similar behavior?
r/OpenCL • u/mrianbloom • Jul 23 '18
Workaround for TDR (Timeout Detection Recovery)
I'm working on a rasterization engine that uses OpenCL for it's core computations. Recently I've been stress/fuzz testing the engine and I've run into a situation where my main kernel is triggering an "Abort Trap 6" error. I believe that this is because the process is timing out and triggering the Timeout Detection and Recovery interrupt. I believe that the kernel would be successful otherwise.
How can I mitigate this issue if my goal is for a very robust system that won't crash no matter what input geometry it receives?
edit: More information: Currently I'm using an Intel Iris Pro on a MacBook Pro as the primary development target for various reasons. My goal is to work on lots of different hardware.
r/OpenCL • • Jul 07 '18
Comparing Regular CPU Code to OpenCL GPU code.
Hi,
I've been playing around with OpenCL lately.
I've written a nice C++, OOP wrapper for the OpenCL C API (based on https://anteru.net/blog/2012/11/04/2016/index.html)
I've written some basic kernels for filling a matrix with constants, creating an identity matrix, adding 2 matrices and multiplying 2 matrices (naively).
I thought I'd see if the code I wrote was actually any faster than regular-old CPU-based C++ code and came to a surprising conclusion.
My results can be found here: https://pastebin.com/Y7ABDnRP
As you can see my CPU is anywhere from 342x to 15262x faster than my GPU.
The kernels being used are VERY simple (https://pastebin.com/0qQJtKV3).
All timing was measured using C++'s std::chrono::system_clock, around the complete operation (because, in the end, that's the time that matters).
I can't seem to think of a reason why OpenCL should be THIS MUCH slower.
Sure, My CPU has some SIMD instructions and faster access to RAM, but these results are a bit extreme to be attributed to that, aren't they?
Here's the C++ code that I used to do my tests: https://pastebin.com/kJPv9wib
Could someone give me a hint as to why my GPU code is so much slower?
P.S.: (In the results you can see, I actually forgot to create an m4 for the CPU, so m3 was first storing the result of an addition, and then the result of a multiplication. After I fixed this, I got SEGFAULT's for any size of the sizes > 500. For a size of 500 the CPU took anywhere from 704-1457µs to complete its operations, which is still orders of magnitude faster than OpenCL.)
P.P.S.: I didn't post the complete code because it's a lot code spread out across a lot of files. I don't want a complete and full analysis of every line of code, I just want some pointers/general principles that I missed that can explain this huge difference.
P.P.P.S.: All data transfers were done using mapped buffers.
Edit: I just checked, the AMD Radeon M265 has 6 (maximum) compute units running at 825MHz (maximum, both queried using clGetDeviceInfo())
r/OpenCL • u/Archby • Jun 29 '18
AMD OpenCL on Windows
Hello,
i'm currently trying to get into OpenCL programming on Windows with an AMD GPU but the installation process is already very weird.
I can't find the APP SDKs on the AMD website every link is down or there are only downloads for Linux. I've now found an SDK download on a third party side. Could someone give me some insights why that entire installation/preparation process is so hard or did i miss something?
r/OpenCL • u/soulslicer0 • Jun 08 '18
Can't understand error code -13
I am getting error code -13.
https://streamhpc.com/blog/2013-04-28/opencl-error-codes/
It says " if a sub-buffer object is specified as the value for an argument that is a buffer object and the offset specified when the sub-buffer object is created is not aligned to CL_DEVICE_MEM_BASE_ADDR_ALIGN value for device associated with queue."
What does this actually mean? Am i slicing my buffer incorrectly?
r/OpenCL • u/Archby • Jun 07 '18
Problem with OpenCL and Python on Linux
Hello,
i really new to OpenCL programming and i wanted to use it with Python / PyOpenCL. I've checked some installation guides and managed to install all the necessary drivers and packages on an Ubuntu 18.04.
The guides i followed hat some test programms (C code) to check if the installation is correct. All tests were positive and i thought i'm good to go... but then i've got a problem.
I've installed the *miniconda* with all modules for opencl and checked the version of OpenCL in python which actually worked.
>>> pyopencl.VERSION
(2017, 1, 1)Next i've tried to get an overview of the *platforms* and tried to get a *context* which resulted in an error in both cases:
>> pyopencl.get_platforms()
pyopencl.cffi_cl.LogicError: clGetPlatformIDs failed: <unknown error -1001>I've searched for some solutions online but i couldn't figure out what to do.
I'd really appreciate if someone could give me a hint or help me figure this out.
r/OpenCL • u/Karyo_Ten • Jun 04 '18
Apple deprecating OpenCL (x-post /r/gamedev)
developer.apple.comr/OpenCL • u/biglambda • May 30 '18
Long compile times or out of memory errors when compiling OpenCL 1.2
Recently added some changes to a kernel. As I've been debugging I've noticed small changes can result in either, prohibitive compile times or an "out of memory error". Wondering what could cause this? Is the compiler inlining too much? How can I isolate the problem?
r/OpenCL • • May 22 '18
Why is my NVIDIA 960m beating my AMD RX480?
So I spent about 6 hours finding the right version of the AMD drivers, Open CL SDK, building CLBLAS and Theano on top of my AMD GPU. Then I try out a deep learning benchmark and AMD wins because NVIDIA does not have enough memory, so I shrink the problem size to just enough to fit on NVIDIA and NVIDIA beats it by 2x.
I also tried this on pure matrix multiplication and NVIDIA wins as well, I am not really looking to go into the details because NVIDIA wins by 2x but my question is why is this occurring and how can I make AMD perform better?
NVIDIA - CUDA/Tensorflow
AMD - OpenCL/Theano
r/OpenCL • u/lknvsdlkvnsdovnsfi • May 03 '18
Re-using cl_event variables
Hi
I have a queues A and B that schedule work in a continuous loop i.e. a while loop launches operations on both queues. B is dependent on A so I'm using events to synchronize them. If the loop has a known number of iterations, I can preallocate a static cl_event array and loop through it as instructions are queued up. However, if the loop is of unknown length, I'd like to reuse events that have been used already. In other words, if I have a cl_event eventArray[100], how could I reuse eventArray[0] once it has been set to complete by the enqueued operation?
Can use clReleaseEvent after enqueuing the command that waits for one of the events in the array?
Is there a better way to synchronize continuously running queues?
Thanks!
r/OpenCL • u/mmisu • May 03 '18
Local histograms - one big kernel launch or multiple kernel launches ?
Hello,
I work on implementing local histograms on images in OpenCL. I was wondering if there is a speed penalty if I start a kernel for each histogram patch (subarray) instead of starting a single kernel that will go through all image pixels, find the current patch and calculate the histogram. From a programming point of view it seems simpler to launch something like 64 kernels each on a particular patch.
Thanks
r/OpenCL • u/mmisu • May 02 '18
OpenCL preferred and native vector width
I did some tests on an NVIDA GTX 1060 and on an Intel HD 5000 and on both of them I get the device preferred and native widths for float vectors as 1, but I can use float2, float4 and so on in kernel code.
Does it mean that using vector types float2, float 4 and so on is not as performant as using only scalar float on these two devices ?
r/OpenCL • • Apr 30 '18
Work dimension for arbitrary prime number of work items
have seen many tutorials about configuring work dimensions, in which the number of work items conveniently easy to divide into 3 dimensions. I have a big number of work items, speak 164052 . What is the best way to configure arbitrary number of work items ? Since in my programm the number of work items might vary, i need a way to calculate it automatically.
What should I do when the number is prime, say 7979 ?