Feat: send cuda compute capability to the server
This commit is contained in:
@@ -33,6 +33,8 @@ public class GPUDevice {
|
||||
|
||||
private String driverVersion;
|
||||
|
||||
private float computeCapability;
|
||||
|
||||
public GPUDevice(String type, String model, long ram, String id) {
|
||||
this.type = type;
|
||||
this.model = model;
|
||||
@@ -46,7 +48,7 @@ public class GPUDevice {
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
return "GPUDevice [type=" + type + ", model='" + model + "', memory=" + memory + ", id=" + id + ", driverVersion=" + driverVersion + "]";
|
||||
return "GPUDevice [type=" + type + ", model='" + model + "', memory=" + memory + ", id=" + id + ", driverVersion=" + driverVersion + ", computeCapability=" + computeCapability + "]";
|
||||
}
|
||||
|
||||
public static int compareVersions(String version1, String version2) {
|
||||
|
||||
@@ -43,4 +43,9 @@ public class CUDeviceAttribute {
|
||||
* Compute capability major version. Return value needs to be > 5 for OptiX support
|
||||
*/
|
||||
public static final int CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR = 75;
|
||||
|
||||
/**
|
||||
* Compute capability minor version.
|
||||
*/
|
||||
public static final int CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR = 76;
|
||||
}
|
||||
|
||||
@@ -226,6 +226,13 @@ public class Nvidia implements GPULister {
|
||||
continue;
|
||||
}
|
||||
|
||||
IntByReference computeCapabilityMinor = new IntByReference();
|
||||
result = cudalib.cuDeviceGetAttribute(computeCapabilityMinor, CUDeviceAttribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, aDevice.getValue());
|
||||
if (result != CUresult.CUDA_SUCCESS) {
|
||||
Log.getInstance().error("Nvidia::getGpus cuDeviceGetAttribute for CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR failed (ret: " + CUresult.stringFor(result) + ")");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
IntByReference pciDomainId = new IntByReference();
|
||||
IntByReference pciBusId = new IntByReference();
|
||||
@@ -307,6 +314,7 @@ public class Nvidia implements GPULister {
|
||||
gpu.setDriverVersion(driverVersion);
|
||||
// for backward compatibility generate a CUDA_N id
|
||||
gpu.setOldId(TYPE + "_" + num);
|
||||
gpu.setComputeCapability(computeCapabilityMajor.getValue() + (float)computeCapabilityMinor.getValue() / 10);
|
||||
devices.add(gpu);
|
||||
}
|
||||
|
||||
|
||||
@@ -352,7 +352,9 @@ public class ServerRequest extends Thread {
|
||||
urlBuilder.addQueryParameter("gpu_model", user_config.getGPUDevice().getModel())
|
||||
.addQueryParameter("gpu_ram", String.valueOf(user_config.getGPUDevice().getMemory()))
|
||||
.addQueryParameter("gpu_type", user_config.getGPUDevice().getType())
|
||||
.addQueryParameter("gpu_cuda_compute_capability", String.valueOf(user_config.getGPUDevice().getComputeCapability()))
|
||||
.addQueryParameter("gpu_driver_version", user_config.getGPUDevice().getDriverVersion());
|
||||
|
||||
}
|
||||
|
||||
Response response = this.HTTPRequest(urlBuilder, RequestBody.create(this.generateXMLForMD5cache(), MediaType.parse("application/xml")));
|
||||
|
||||
Reference in New Issue
Block a user