Which is the command to see the "correct" CUDA Version that pytorch in conda env is seeing? This, is a similar question, but doesn't get me far.
nvidia-smi says I have cuda version 10.1
conda list tells me cudatoolkit version is 10.2.89
torch.cuda.is_available() shows FALSE, so it sees No CUDA?
print(torch.cuda.current_device()), I get 10.0.10 (10010??) (it
looks like):
AssertionError: The NVIDIA driver on your system is too old
(found version 10010)
print(torch._C._cuda_getCompiledVersion(), 'cuda compiled version') tells me my version is 10.0.20 (10020??)?
10020 cuda compiled version
Why are there so many different versions? What am I missing?
P.S
I have Nvidia driver 430 on Ubuntu 16.04 with Geforce 1050. It comes
with libcuda1-430 when I installed the driver from additional drivers tab in ubuntu (Software and Updates). I installed pytorch
with conda which also installed the cudatoolkit using conda install -c fastai -c pytorch -c anaconda fastai
In the conda env (myenv) where pytorch is installed do the following:
conda activate myenv
torch.version.cuda
Nvidia-smi only shows compatible version. Does not seem to talk about the version pytorch's own cuda is built on.
Related
I installed the CUDA toolkit and CUDNN and added it to the PATH, but this function still returns False.
import tensorflow as tf
print(tf.test.is_built_with_cuda())
I use JupyterNotebook from the Anaconda distribution.
The OS is Windows 11. CUDA v11. CUDNN v8.7. Also have zlib dll.
The command
nvcc -V
in PowerShell works, it outputs the CUDA version.
TensorFlow also does not detect the graphics card because of CUDA.
print(tensorflow.config.list_physical_devices())
This code returns information only about CPU.
You need to install CUDA 11.2 and cuDNN 8.1 as per this build configurations to enable Tensorflow GPU support in your system.
Please install all the required software for GPU support and set the PATH for these software to the bin directory.
Then use below code for TF-gpu setup in conda environment.
conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0
pip install --upgrade pip
# Anything above 2.10 is not supported on the GPU on Windows Native
pip install "tensorflow-gpu<2.11"
To verify the GPU setup:
python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
I'm trying to use tensorflow with my PC's GPU (Nvidia RTX 3070Ti) in python-conda environment. I'm solving a small image-classification problem from kaggle. I've solved it in google-collab, but now I'm intrested in solving it on my local machine. However TF doesn't work properly locally and I have no idea why. I've read tons of solutions but it didn't help yet.
I'm following this guide and always install proper versions of TF and CUDA: https://www.tensorflow.org/install/source_windows
cuda-toolkit 10.1, cudnn 7.6, tf-gpu 2.3, python 3.8
Also I've installed latest NVidia drivers for videocard.
What I've tried:
I've installed proper version CUDA-toolkit and CUDnn from nvidia site. I've installed it properly and included everything that was needed into PATH. I've checked it - MS Visiual Studio finds both CUDA and CUDnn and can work with it. I've installed proper version of Tensorflow-GPU using conda into my environment.
Result: TF can't find my GPU and uses only CPU.
I've removed all CUDA and CUDAnn drivers. I've installed CUDA-toolkit, CUDnn and Tensorflow-GPU python packages into my conda environment.
Result: TF recognizes my GPU and uses it! But during DNN training happens error: Failed to launch ptxas Relying on driver to perform ptx compilation. Modify $PATH to customize ptxas location. And training goes very bad - accuracy is very low and doesn't improving.
When I use absolutely same code and data on google-collab, everything is going smoothly - I get ~90% accuracy on 5th epoch.
I've tried tf 2.1 and relevant cuda and cudnn, but it's still same result!
I've tried to install cudatoolkit-dev, but it didn't help to solve ptxas problem.
I'm about to give up and use PyTorch instead of Tensorflow.
So here is what worked for me:
Create 3.9 python environment
Install cuda and tensorflow packages from "Esri":
conda install -c esri cudatoolkit
conda install -c esri cudnn
conda install -c esri tensorflow-gpu
Then install tensorflow-hub:
conda install -c conda-forge tensorflow-hub
It will downgrade installations from previous steps, but it works. Maybe installing tensorflow-hub first could help to avoid it, but I didn't test it.
This weekend I have been trying a lot to install and get Tensorflow with GPU support to work on my computer, but I am not very experienced in using pip/conda and are now quite confused after watching and trying a lot of different tutorials/approaches from the web.
I have a GeForce GTX 1650 graphics card, and I have installed Cuda 10.0 (also 11.2, but I removed it from "PATH" and are only using the 10.0 version, I don't think that's a problem).
I have downloaded cuDNN 7.5.0 for CUDA 10, and I think that I have copied and placed the files correctly (installed cuDNN).
I am just trying to get some version of Tensorflow-gpu to work, but you can see the Tensorflow version i have been trying for now on the image.
I have tried to install and uninstall Python from my computer (I've also reinstalled Anaconda a lot of times), because I am not sure if I need to have a Python version installed (on my system) if I install a version of Python inside my Anaconda environment (in my example Python 3.7).
Does anyone know how to install Tensorflow GPU on Windows 10 with my settings (cuDNN 7.5.0, CUDA 10), or maybe have encountered some trouble with Python versions or Anaconda problems similar to mine?
Follow these steps to install Tensorflow GPU on windows system.
Make sure right version of Visual studio is installed. Check here.
Follow the instructions mentioned here to setup CUDA for windows system
Install Tensorflow
#check current python version
python --version
#Create the virtual environment
conda create -n tf python=PYTHON_VERSION
#Activate the tf environment
conda activate tf
#Install Tensorflow
pip install tensorflow
#Install CUDA and cuDNN using conda and make sure CUDA and cuDNN version should match the Tensorflow version
conda install -c anaconda cudatoolkit=10.0 cudnn=7.5
How do I install TensorFlow 2.2 with Nvidia Geforce GTX 1650 with Anoconda (on Windows 10)
I want to know whether this anaconda command will work instead of manually installing all the required files like CUDA toolkit, CUdnn and TensorRT (for TensorFlow version 2.2 GPU).
$conda create Test Tensorflow-gpu==2.1
$conda activate Test
$pip3 install Tensorflow-gpu==2.2
Note: I will manually download the GPU driver as recommended on tensorflow official website!
I do pip3 install tensorflow-gpu (for version 2.2) because as per TensorFlows Official website both 2.1 & 2.2 use the same CUDA & cuDNN version.
Right now it looks like Anaconda's highest version of Tensorflow is 2.1. If you want 2.2 you'll need to install tensorflow gpu, cuda, and cudnn manually.
I am trying to install the lastest version of pytorch with cuda enabled that is version pytorch v1.2 and cuda v9.2 which corresponds with my nvcc version (9.2) on a python 2.7 environment created using conda. (venv)
The command that I used was: conda install pytorch torchvision cudatoolkit=9.2 -c pytorch
which I was given as per my system configurations on the official pytorch website.
But then when I check on the python command line, my pytorch version still shows v0.4.1 and cuda v9.0.