forked from bartvdbraak/blender
Cycles: Blacklist unsupported OpenCL devices
Due to various driver issues with AMD GCN 1 cards we can no longer support these GPUs. This patch makes them unavailable to select for Cycles rendering. GCN cards 2 and higher are still supported. Please use the most recent drivers available to ensure proper functionality. See here for a list to check which GPUs are supported: https://en.wikipedia.org/wiki/List_of_AMD_graphics_processing_units
This commit is contained in:
parent
c73206acc5
commit
1f0998baa7
@ -130,6 +130,11 @@ public:
|
|||||||
cl_int* error = NULL);
|
cl_int* error = NULL);
|
||||||
static cl_device_type get_device_type(cl_device_id device_id);
|
static cl_device_type get_device_type(cl_device_id device_id);
|
||||||
|
|
||||||
|
static bool get_driver_version(cl_device_id device_id,
|
||||||
|
int *major,
|
||||||
|
int *minor,
|
||||||
|
cl_int* error = NULL);
|
||||||
|
|
||||||
static int mem_address_alignment(cl_device_id device_id);
|
static int mem_address_alignment(cl_device_id device_id);
|
||||||
|
|
||||||
/* Get somewhat more readable device name.
|
/* Get somewhat more readable device name.
|
||||||
|
@ -608,6 +608,14 @@ bool OpenCLInfo::device_supported(const string& platform_name,
|
|||||||
if(!get_device_name(device_id, &device_name)) {
|
if(!get_device_name(device_id, &device_name)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int driver_major = 0;
|
||||||
|
int driver_minor = 0;
|
||||||
|
if(!get_driver_version(device_id, &driver_major, &driver_minor)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
VLOG(3) << "OpenCL driver version " << driver_major << "." << driver_minor;
|
||||||
|
|
||||||
/* It is possible tyo have Iris GPU on AMD/Apple OpenCL framework
|
/* It is possible tyo have Iris GPU on AMD/Apple OpenCL framework
|
||||||
* (aka, it will not be on Intel framework). This isn't supported
|
* (aka, it will not be on Intel framework). This isn't supported
|
||||||
* and needs an explicit blacklist.
|
* and needs an explicit blacklist.
|
||||||
@ -618,6 +626,21 @@ bool OpenCLInfo::device_supported(const string& platform_name,
|
|||||||
if(platform_name == "AMD Accelerated Parallel Processing" &&
|
if(platform_name == "AMD Accelerated Parallel Processing" &&
|
||||||
device_type == CL_DEVICE_TYPE_GPU)
|
device_type == CL_DEVICE_TYPE_GPU)
|
||||||
{
|
{
|
||||||
|
if(driver_major < 2348) {
|
||||||
|
VLOG(1) << "AMD driver version " << driver_major << "." << driver_minor << " not supported";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const char *blacklist[] = {
|
||||||
|
/* GCN 1 */
|
||||||
|
"Tahiti", "Pitcairn", "Capeverde", "Oland",
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
for (int i = 0; blacklist[i] != NULL; i++) {
|
||||||
|
if(device_name == blacklist[i]) {
|
||||||
|
VLOG(1) << "AMD device " << device_name << " not supported";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if(platform_name == "Apple" && device_type == CL_DEVICE_TYPE_GPU) {
|
if(platform_name == "Apple" && device_type == CL_DEVICE_TYPE_GPU) {
|
||||||
@ -1073,6 +1096,34 @@ string OpenCLInfo::get_readable_device_name(cl_device_id device_id)
|
|||||||
return get_device_name(device_id);
|
return get_device_name(device_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool OpenCLInfo::get_driver_version(cl_device_id device_id,
|
||||||
|
int *major,
|
||||||
|
int *minor,
|
||||||
|
cl_int* error)
|
||||||
|
{
|
||||||
|
char buffer[1024];
|
||||||
|
cl_int err;
|
||||||
|
if((err = clGetDeviceInfo(device_id,
|
||||||
|
CL_DRIVER_VERSION,
|
||||||
|
sizeof(buffer),
|
||||||
|
&buffer,
|
||||||
|
NULL)) != CL_SUCCESS)
|
||||||
|
{
|
||||||
|
if(error != NULL) {
|
||||||
|
*error = err;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(error != NULL) {
|
||||||
|
*error = CL_SUCCESS;
|
||||||
|
}
|
||||||
|
if(sscanf(buffer, "%d.%d", major, minor) < 2) {
|
||||||
|
VLOG(1) << string_printf("OpenCL: failed to parse driver version string (%s).", buffer);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
int OpenCLInfo::mem_address_alignment(cl_device_id device_id)
|
int OpenCLInfo::mem_address_alignment(cl_device_id device_id)
|
||||||
{
|
{
|
||||||
int base_align_bits;
|
int base_align_bits;
|
||||||
|
Loading…
Reference in New Issue
Block a user