drain the oil and make sure its got the right grade in it. sounds like it might be a a hydraulic lifter on the camshaft not getting lubricated due to oil being to thick then once warmed it thins out . other option could be a diesel knock. Extra diesel is put into the cylinders when its cold . use a diagnostic tool to check what readings are being sent to the ecu from the engine temperature sensor as that is what control,s the cold start