If you
- got message like "CUDA.framework is malware, ... damage on your mac"
- using OpenCL instead
- using macOS 10.14+ (used Metal framework instead)
and try to remove it.
Delete the following folders/files:
sudo rm -rf /Library/Frameworks/CUDA.framework
sudo rm -rf /Library/LaunchAgents/com.nvidia.CUDASoftwareUpdate.plist
sudo rm -rf /Library/PreferencePanes/CUDA/Preferences.prefPane
sudo rm -rf /System/Library/StartupItems/CUDA/
sudo rm -rf /System/Library/Extensions/CUDA.kext
If you installed the tookits and samples, delete the following also:
sudo rm -rf /Developer/NVIDIA/CUDA-x.x # your cuda version
sudo rm -rf /usr/local/cuda
sudo rm -rf /frameworks