Can't run my program on RTX 4080

I change my card from RTX 3070 to 4080. I use nvrtc in my project and the nvrtc options before are: “-arch=compute_86”, “-rdc=true”, “–std=c++11”, “-I/usr/local/cuda/include”. The project works well on RTX 3070 platform. After changing to RTX 4080, I modify the options to “-arch=compute_89”, “-rdc=true”, “–std=c++11”, “-I/usr/local/cuda/include”. Now the project doesn’t work, such an error occurs: “identifier “cudaDeviceSynchronize” is undefined”
PS: I also update the CUDA version to 12.0

I guess the possible reason is that the function “cudaDeviceSynchronize” in the kernel is deprecated now.

One has to distinguish between “deprecated” and “removed”. A feature is deprecated when its removal is planned in the future but it is still supported for now. It is a vendor’s way of warning users about the future removal of a feature, allowing programmers some time to transition their code base.

The situation with regard to cudaDeviceSynchronize is stated very clearly in the CUDA documentation:

Use of cudaDeviceSynchronize in device code was deprecated in CUDA 11.6 and removed for compute_90+ compilation. For compute capability < 9.0, compile-time opt-in by specifying -D CUDA_FORCE_CDP1_IF_SUPPORTED is required to continue using cudaDeviceSynchronize() in device code for now.

The RTX 4080 has compute capability 8.9 (sm_89, compute_89), so you should be able to use the opt-in feature spelled out by the documentation. As usage in device code is deprecated, you would want to plan adjusting your code base real soon now. The deprecation was announced a year ago, and based on historical observation, NVIDIA usually allows for a 2-year transition window before removal of a feature. So the clock is ticking …

1 Like

Thanks so much, it definitely solves my problem.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.