NVlabs / NVBit

200 stars 18 forks source link

Disable Instrumentation for Turing GPUs #17

Closed ZejiaZheng closed 4 years ago

ZejiaZheng commented 4 years ago

We have an instrumentation tool written and we would like to selectively run instrumentation on non-Turing types of GPUs. We added this function to our tool:

bool is_gpu_turing() {
    int device_id;
    cudaDeviceProp prop;
    cudaGetDevice(&device_id);

    cudaGetDeviceProperties(&prop, device_id);
    int compute_capability = prop.major * 10 + prop.minor;
    if (compute_capability >= 75) {
        return true;
    }
    return false;
}

We added this function at the beginning of nvbit_at_init(), nvbit_at_function_first_load(), nvbit_at_cuda_event(), and nvbit_at_term() to skip instrumentation if the GPU is Turing.

However, we still got this failure:

NVBit ERROR: SM 7.5 name GeForce RTX 2080 Ti not supported

Is there a way for this to work inside the tool? Or should we try a different approach (e.g., disabling LD_PRELOAD in the shell script when turing is detected)?

x-y-z commented 4 years ago

NVBit currently cannot be disabled once it is loaded. So you will need to disable LD_PRELOAD in the shell script when Turing is detected.

ZejiaZheng commented 4 years ago

Thank you @x-y-z