For my personal situation, just add the following code
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
gpus = tf.config.experimental.list_physical_devices("GPU")
if gpus:
try:
for gpu in gpus:
tf.config.experimental.set_memory_growth(gpu, True)
except RuntimeError as e:
print(e)
exit(-1)
Reference:
Read More:
- [Solved] Failed to get convolution algorithm. This is probably because cuDNN failed to initialize
- [Solved] TF2.4 Error: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize
- Tensorflow Error: Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
- [How to Solve] Internal: blas sgemm launch failed
- Error using tensorflow GPU: could not create cudnn handle: cudnn_STATUS_NOT_INITIALIZED
- Tensorflow Run Error or the interface is stuck or report error: Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
- Android integration of iFLYTEK’s speech recognition (voice dictation) error message “Failed to create the object, please confirm that libmsc.so is placed correctly, and createUtility is called to initialize”
- [Solved] K8s Initialize Error: failed with error: Get “http://localhost:10248/healthz“
- [Solved] Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
- [Solved] Logging system failed to initialize using configuration from ‘classpathlogbacklogback-spring.xml‘
- [Solved] Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode.
- [Solved] Failed to register: Error: Failed to get admin…. run enrollAdmin.js
- RuntimeError: CUDNN_STATUS_EXECUTION_FAILED [How to Solve]
- [Solved] Tensorflow Error: failed to create cublas handle: CUBLAS_STATUS_ALLOC_FAILED
- [Solved] loadrunner Error: Failed to Initialize. Reason: TimeOut
- [Solved] RuntimeError: cuDNN error: CUDNN_STATUS_INTERNAL_ERROR
- How to Solve Docker failed to initialize Error
- [Solved] KeyCloak users check their profile error: “failed to initialize keycloak”
- [Solved] Win nvidia-smi Cann’t Use,Failed to initialize NVML: Unknown Error
- [Solved] ssh secure shell: server responded algorithm negotiation failed