[v0.11] Fixes to recover CUDA functionality, ready for implementing Intel iGPU code
This commit is contained in:
@@ -73,10 +73,10 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
set_log_level(true);
|
||||
|
||||
printWarn("gpufetch is in beta. The provided information may be incomplete or wrong.\n\
|
||||
printf("[WARNING]: gpufetch is in beta. The provided information may be incomplete or wrong.\n\
|
||||
If you want to help to improve gpufetch, please compare the output of the program\n\
|
||||
with a reliable source which you know is right (e.g, techpowerup.com) and report\n\
|
||||
any inconsistencies to https://github.com/Dr-Noob/gpufetch/issues");
|
||||
any inconsistencies to https://github.com/Dr-Noob/gpufetch/issues\n");
|
||||
|
||||
struct gpu_info* gpu = get_gpu_info(list, get_gpu_idx());
|
||||
if(gpu == NULL)
|
||||
|
||||
@@ -42,12 +42,12 @@ bool print_gpus_list(struct gpu_list* list) {
|
||||
for(int i=0; i < list->num_gpus; i++) {
|
||||
printf("GPU %d: ", i);
|
||||
if(list->gpus[i]->vendor == GPU_VENDOR_NVIDIA) {
|
||||
#ifdef ENABLE_CUDA_BACKEND
|
||||
#ifdef BACKEND_CUDA
|
||||
print_gpu_cuda(list->gpus[i]);
|
||||
#endif
|
||||
}
|
||||
else if(list->gpus[i]->vendor == GPU_VENDOR_INTEL) {
|
||||
#ifdef ENABLE_INTEL_BACKEND
|
||||
#ifdef BACKEND_INTEL
|
||||
print_gpu_intel(list->gpus[i]);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -6,44 +6,12 @@
|
||||
#include "../common/pci.hpp"
|
||||
#include "../common/global.hpp"
|
||||
|
||||
int print_gpus_list_deprecated() {
|
||||
cudaError_t err = cudaSuccess;
|
||||
int num_gpus = -1;
|
||||
|
||||
if ((err = cudaGetDeviceCount(&num_gpus)) != cudaSuccess) {
|
||||
printErr("%s: %s", cudaGetErrorName(err), cudaGetErrorString(err));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
printf("CUDA GPUs available: %d\n", num_gpus);
|
||||
|
||||
if(num_gpus > 0) {
|
||||
cudaDeviceProp deviceProp;
|
||||
int max_len = 0;
|
||||
|
||||
for(int idx=0; idx < num_gpus; idx++) {
|
||||
if ((err = cudaGetDeviceProperties(&deviceProp, idx)) != cudaSuccess) {
|
||||
printErr("%s: %s", cudaGetErrorName(err), cudaGetErrorString(err));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
max_len = max(max_len, (int) strlen(deviceProp.name));
|
||||
}
|
||||
|
||||
for(int i=0; i < max_len + 32; i++) putchar('-');
|
||||
putchar('\n');
|
||||
for(int idx=0; idx < num_gpus; idx++) {
|
||||
if ((err = cudaGetDeviceProperties(&deviceProp, idx)) != cudaSuccess) {
|
||||
printErr("%s: %s", cudaGetErrorName(err), cudaGetErrorString(err));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
printf("GPU %d: %s (Compute Capability %d.%d)\n", idx, deviceProp.name, deviceProp.major, deviceProp.minor);
|
||||
}
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
bool print_gpu_cuda(struct gpu_info* gpu) {
|
||||
return false;
|
||||
char* cc = get_str_cc(gpu->arch);
|
||||
printf("%s (Compute Capability %s)\n", gpu->name, cc);
|
||||
free(cc);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
struct cache* get_cache_info(cudaDeviceProp prop) {
|
||||
@@ -127,8 +95,10 @@ struct gpu_info* get_gpu_info_cuda(int gpu_idx) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(gpu_idx == 0) {
|
||||
printf("Waiting for CUDA driver to start...");
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
int num_gpus = -1;
|
||||
cudaError_t err = cudaSuccess;
|
||||
@@ -136,7 +106,10 @@ struct gpu_info* get_gpu_info_cuda(int gpu_idx) {
|
||||
printErr("%s: %s", cudaGetErrorName(err), cudaGetErrorString(err));
|
||||
return NULL;
|
||||
}
|
||||
printf("\r ");
|
||||
|
||||
if(gpu_idx == 0) {
|
||||
printf("\r");
|
||||
}
|
||||
|
||||
if(num_gpus <= 0) {
|
||||
printErr("No CUDA capable devices found!");
|
||||
@@ -144,7 +117,7 @@ struct gpu_info* get_gpu_info_cuda(int gpu_idx) {
|
||||
}
|
||||
|
||||
if(gpu->idx+1 > num_gpus) {
|
||||
printErr("Requested GPU index %d in a system with %d GPUs", gpu->idx, num_gpus);
|
||||
// Master is trying to query an invalid GPU
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
struct gpu_info* get_gpu_info_intel() {
|
||||
struct gpu_info* gpu = (struct gpu_info*) emalloc(sizeof(struct gpu_info));
|
||||
gpu->vendor = GPU_VENDOR_INTEL;
|
||||
|
||||
return gpu;
|
||||
}
|
||||
@@ -14,7 +15,7 @@ struct gpu_info* get_gpu_info_intel() {
|
||||
bool print_gpu_intel(struct gpu_info* gpu) {
|
||||
if(gpu->vendor != GPU_VENDOR_INTEL) return false;
|
||||
|
||||
printf("%s\n", gpu->name);
|
||||
printf("Intel ???\n");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user