Skip to content

__ldg intrinsic unavailable on compute capability <3.2 #320

Closed

Description

@levskaya

I'm not sure if supporting compute 3.0 capability will ever be a priority for the project, it's mainly useful for people who want to train small convnets on AWS g2.2x and g2.8x boxes as they're learning the framework.

A very recent commit 9c3043f added the read-only data cache load function intrinsic __ldg to two operation defs: conv_ops_gpu_3.cu.cc and bias_op_gpu.cu.cc

All that's needed to maintain 3.0 support is to pass through __ldg(x) as a pointer --> *x (I've confirmed this compiles and runs fine on the AWS GPU instances) One could do this properly in theory with e.g. a generic wrapper: (this is way too simplistic I'm sure...)

template<typename T>
__device__ __forceinline__ T ldg(const T* ptr) {
#if __CUDA_ARCH__ >= 320
    return __ldg(ptr);
#else
    return *ptr;
#endif
}

Again, it's mainly an issue if you want to keep the unsupported TF_UNOFFICIAL_SETTING=1 option working for people who happen to be working with slightly older GPUs. (BTW thanks for all the amazing work!)

Activity

  1. vrv commented on Dec 23, 2015

    @vrv

    854f49b Fixed this a while ago, I believe.

  2. added a commit that references this issue on Dec 17, 2019
    50caa98
  3. added a commit that references this issue on May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions