Skip to content

Commit 5df9952

Browse files
committed
Fixed maximum buffer allocation size limit for AMD GPUs
1 parent 281e955 commit 5df9952

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/opencl.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,10 @@ inline void print_device_info(const Device_Info& d) { // print OpenCL device inf
178178
inline vector<Device_Info> get_devices(const bool print_info=true) { // returns a vector of all available OpenCL devices
179179
#if defined(_WIN32)
180180
(void)_putenv((char*)"CL_CONFIG_CPU_FORCE_MAX_MEM_ALLOC_SIZE=17179869183GB"); // fix maximum buffer allocation size limit in Intel CPU Runtime for OpenCL, 2^34-1 is max non-overflowing value
181+
(void)_putenv((char*)"GPU_SINGLE_ALLOC_PERCENT=100"); // fix maximum buffer allocation size limit for AMD GPUs
181182
#elif defined(__linux__)
182183
(void) putenv((char*)"CL_CONFIG_CPU_FORCE_MAX_MEM_ALLOC_SIZE=17179869183GB"); // fix maximum buffer allocation size limit in Intel CPU Runtime for OpenCL, 2^34-1 is max non-overflowing value
184+
(void) putenv((char*)"GPU_SINGLE_ALLOC_PERCENT=100"); // fix maximum buffer allocation size limit for AMD GPUs
183185
#endif // Linux
184186
vector<Device_Info> devices; // get all devices of all platforms
185187
vector<cl::Platform> cl_platforms; // get all platforms (drivers)

0 commit comments

Comments
 (0)