
Production code should instead use ROCArray once its ready, in a similar fashion to CuArray. HSAArray is a lightweight low-level array type, that does not support the GPUArrays.jl interface. We need to create one additional array c_d to store the results: c_d = similar(a_d) We can create the two arrays by passing the host data to the constructor as follows: using AMDGPU Toward that end, we will use the HSAArray type to represent our GPU arrays. To do the same computation on the GPU, we first need to copy the two input arrays a and b to the device.


We can start by first performing this simple calculation on the CPU: N = 32 Libdl.dlopen("/opt/rocm/hsa/lib/libhsa-runtime64.so") Running a simple kernelĪs a simple test, we will try to add two random vectors and make sure that the results from the CPU and the GPU are indeed the same. You can quickly debug this issue by starting Julia and trying to load a ROCm library: using Libdl For more information, check out this GitHub issue.Ī quick fix is to use the LD_PRELOAD environment variable to make Julia use the system C++ runtime library, for example: LD_PRELOAD=/usr/lib/libstdc++.so juliaĪlternatively, you can build Julia from sources as described here. If you built the ROCm stack yourself this is very likely the case since Julia normally ships with its own C++ runtime. not found, it's possible that the C++ runtime used to build the ROCm stack and the one used by Julia are different. If you get an error message along the lines of GLIB_CXX_.
