loading the same texture with GL_R8 works just fine, but loading with GL_R8UI throws an GL_INVALID_OPERATION. I am on an OpenGL 3.3 core context profile, but I loaded the extention ARB_direct_state_access. These are the function calls that are tracked from apitrace:
glCreateTextures(GL_TEXTURE_2D, 1, ) //  means that two is the value that got stored in the parameter array
glTextureStorage2D(2, 1, GL_R8UI, 1024, 1024)
glTextureParameteri(2, GL_TEXTURE_MIN_FILTER, GL_NEAREST)
glTextureParameteri(2, GL_TEXTURE_MAG_FILTER, GL_NEAREST)
glGetTextureLevelParameteriv(2, 0, GL_TEXTURE_WIDTH, )
glGetTextureLevelParameteriv(2, 0, GL_TEXTURE_HEIGHT, )
glTextureSubImage2D(texture=2, level=0, xoffset=0, yoffset=0, width=1024, height=1024, format = GL_RED, type = GL_UNSIGNED_BYTE, pixels = [binary data, size = 1024kb])
and this is the error message:
message: GL_INVALID_OPERATION error generated. Texture type and format combination is not valid.
The format parameter should be GL_RED_INTEGER for an integer texture (the online reference page is incorrect on this point; the list of acceptable values for format doesn’t appear to have been updated since integer textures were added).
Unfortunately, information is often fairly scattered. E.g. the description of glTexSubImage2D() just refers to glTexImage2D() which refers to glTexImage3D() which refers to the “Transfer of Pixel Rectangles” section.