<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									WSL - how to install cuda for tensorflow and gpu computing - BugOverflow				            </title>
            <link>https://muszak.eu/community/bugoverflow/wsl-how-to-install-cuda-for-tensorflow-and-gpu-computing/</link>
            <description>muszak.eu Forum dyskusyjne</description>
            <language>pl-PL</language>
            <lastBuildDate>Sun, 19 Apr 2026 21:51:28 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>Odpowiedź na: WSL - how to install cuda for tensorflow and gpu computing</title>
                        <link>https://muszak.eu/community/bugoverflow/wsl-how-to-install-cuda-for-tensorflow-and-gpu-computing/#post-1241</link>
                        <pubDate>Sun, 04 Jun 2023 13:40:25 +0000</pubDate>
                        <description><![CDATA[Based on tensorflow compatibility list and version tensorflow-2.12.0 
apt update
apt install cuda-toolkit-11-8
wget
dpkg -i cuda-keyring_1.0-1_all.deb
sudo apt-key del 7fa2af80
apt inst...]]></description>
                        <content:encoded><![CDATA[Based on <a href="https://www.tensorflow.org/install/source?hl=pl#tested_build_configurations " target="_blank" rel="noopener">tensorflow compatibility list</a> and version tensorflow-2.12.0 <br /><br />
<pre contenteditable="false">apt update
apt install cuda-toolkit-11-8
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb
dpkg -i cuda-keyring_1.0-1_all.deb
sudo apt-key del 7fa2af80
apt install python3-pip
pip install tensorflow
add-apt-repository ppa:graphics-drivers/ppa
apt-get install cuda-11-8 numactl
apt-get install libcudnn8=8.6.*-1+cuda11.8</pre>
<p>Test:</p>
<pre contenteditable="false">nvidia-smi 
nvcc -V</pre>
<p>Then final test:</p>
<pre contenteditable="false">python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"</pre>
<p>or check number of gpu's using script test.py</p>
<pre contenteditable="false">from transformers import GPT2Tokenizer
from transformers import AutoTokenizer
import tensorflow as tf
tokenizer = AutoTokenizer.from_pretrained('sdadas/polish-gpt2-medium')

print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))

text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris et sem interdum, vehicula erat sit amet, aliquet nisl. Phasellus at tellus et turpis viverra bibendum tincidunt eu arcu. Nunc varius venenatis condimentum. Aliquam auctor efficitur ligula."

tokens = tokenizer.encode(text, add_special_tokens=False)
num_tokens = len(tokens)

print("Number of tokens:", num_tokens)</pre>
<p>Got troubles with </p>
<pre contenteditable="false">libcuinj64-11.5 : Depends: libnvidia-compute-495 (&gt;= 495) but it is not going to be installed or</pre>
<p>or</p>
<pre contenteditable="false">numba.cuda.cudadrv.driver.CudaAPIError:  Call to cuInit results in CUDA_ERROR_NO_DEVICE</pre>
<p>then try with this commands and test cuda script again</p>
<pre contenteditable="false">apt-get purge 'nvidia-.*'
apt-get install nvidia-cuda-toolkit</pre>]]></content:encoded>
						                            <category domain="https://muszak.eu/community/bugoverflow/">BugOverflow</category>                        <dc:creator>mrmucha</dc:creator>
                        <guid isPermaLink="true">https://muszak.eu/community/bugoverflow/wsl-how-to-install-cuda-for-tensorflow-and-gpu-computing/#post-1241</guid>
                    </item>
				                    <item>
                        <title>WSL - how to install cuda for tensorflow and gpu computing</title>
                        <link>https://muszak.eu/community/bugoverflow/wsl-how-to-install-cuda-for-tensorflow-and-gpu-computing/#post-1240</link>
                        <pubDate>Sun, 04 Jun 2023 13:38:04 +0000</pubDate>
                        <description><![CDATA[example]]></description>
                        <content:encoded><![CDATA[<p>example</p>]]></content:encoded>
						                            <category domain="https://muszak.eu/community/bugoverflow/">BugOverflow</category>                        <dc:creator>mrmucha</dc:creator>
                        <guid isPermaLink="true">https://muszak.eu/community/bugoverflow/wsl-how-to-install-cuda-for-tensorflow-and-gpu-computing/#post-1240</guid>
                    </item>
							        </channel>
        </rss>
		