# Cuda no longer work when installing new ubuntu update

**URL:** <https://deeptalk.lambda.ai/t/cuda-no-longer-work-when-installing-new-ubuntu-update/520>\
**Category:** Uncategorized\
**Created:** [September 21, 2018, 10:29pm UTC](https://deeptalk.lambda.ai/t/cuda-no-longer-work-when-installing-new-ubuntu-update/520 "2018-09-21T22:29:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![binhvanpham](https://sea1.discourse-cdn.com/flex019/user_avatar/deeptalk.lambda.ai/binhvanpham/32/567_2.png) [@binhvanpham](https://deeptalk.lambda.ai/u/binhvanpham)\
**Post date:** [September 21, 2018, 10:29pm UTC](https://deeptalk.lambda.ai/t/cuda-no-longer-work-when-installing-new-ubuntu-update/520/1 "2018-09-21T22:29:05Z")

</div>

Hi I just recently make update to latest ubuntu version. However, cuda no longer work.

When I compile using nvcc I got this msg

nvcc warning : The ‘compute\_20’, ‘sm\_20’, and ‘sm\_21’ architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).  
In file included from /usr/local/cuda/bin/…//include/cuda\_runtime.h:78:0,  
from :0:  
/usr/local/cuda/bin/…//include/host\_config.h:119:2: error: #error – unsupported GNU version! gcc versions later than 5 are not supported!  
#error – unsupported GNU version! gcc versions later than 5 are not supported!  
^ ~~~~

Would you please help reinstall CUDA?

Thank you,  
–Binh Pham

---

<div class="post-metadata">

**Author:** ![sabalaba](https://sea1.discourse-cdn.com/flex019/user_avatar/deeptalk.lambda.ai/sabalaba/32/4_2.png) [@sabalaba](https://deeptalk.lambda.ai/u/sabalaba)\
**Post date:** [September 24, 2018, 2:48pm UTC](https://deeptalk.lambda.ai/t/cuda-no-longer-work-when-installing-new-ubuntu-update/520/2 "2018-09-24T14:48:36Z")

</div>

Hey Binh,

You can try to use Lambda Stack. [Lambda Stack: an AI software stack that's always up-to-date](https://lambdalabs.com/lambda-stack-deep-learning-software)

That will install TensorFlow with GPU support / CUDA / Drivers / etc. Let us know if that one-liner works:

```auto
LAMBDA_REPO=$(mktemp) && \
wget -O${LAMBDA_REPO} https://lambdalabs.com/static/misc/lambda-stack-repo.deb && \
sudo dpkg -i ${LAMBDA_REPO} && rm -f ${LAMBDA_REPO} && \
sudo apt-get update && sudo apt-get install -y lambda-stack-cuda

```

---

<div class="post-metadata">

**Author:** ![binhvanpham](https://sea1.discourse-cdn.com/flex019/user_avatar/deeptalk.lambda.ai/binhvanpham/32/567_2.png) [@binhvanpham](https://deeptalk.lambda.ai/u/binhvanpham)\
**Post date:** [September 24, 2018, 4:11pm UTC](https://deeptalk.lambda.ai/t/cuda-no-longer-work-when-installing-new-ubuntu-update/520/3 "2018-09-24T16:11:35Z")

</div>

Hi,  
The command works after I added --allow-downgrades. However, when I run a test cuda code, it doesn’t work. It gives me wrong result. This code works before. Below is my test code and output.

CODE:  
#include \<stdio.h\>

**global** void cube(float \* d\_out, float \* d\_in){  
// Todo: Fill in this function  
int idx = threadIdx.x;  
float f = d\_in[idx];  
d\_out[idx] = f_f_f;  
}

int main(int argc, char \*\* argv) {  
const int ARRAY\_SIZE = 96;  
const int ARRAY\_BYTES = ARRAY\_SIZE \* sizeof(float);

// generate the input array on the host  
float h\_in[ARRAY\_SIZE];  
for (int i = 0; i \< ARRAY\_SIZE; i++) {  
h\_in[i] = float(i);  
}  
float h\_out[ARRAY\_SIZE];

// declare GPU memory pointers  
float \* d\_in;  
float \* d\_out;

// allocate GPU memory  
cudaMalloc((void\*\*) &d\_in, ARRAY\_BYTES);  
cudaMalloc((void\*\*) &d\_out, ARRAY\_BYTES);

// transfer the array to the GPU  
cudaMemcpy(d\_in, h\_in, ARRAY\_BYTES, cudaMemcpyHostToDevice);

// launch the kernel  
cube\<\<\<1, ARRAY\_SIZE\>\>\>(d\_out, d\_in);

// copy back the result array to the CPU  
cudaMemcpy(h\_out, d\_out, ARRAY\_BYTES, cudaMemcpyDeviceToHost);

// print out the resulting array  
for (int i =0; i \< ARRAY\_SIZE; i++) {  
printf(“%f”, h\_out[i]);  
printf(((i % 4) != 3) ? “\t” : “\n”);  
}

cudaFree(d\_in);  
cudaFree(d\_out);

return 0;  
}

OUTPUT:  
64856.226562 -3442308913561600.000000 -0.040856 -8858266431913984.000000  
0.000000 0.000000 0.000000 0.000000  
0.000000 0.000000 -0.000000 0.000000  
0.000000 0.000000 -nan -nan  
0.000000 0.000000 0.000000 0.000000  
0.000000 0.000000 0.000000 0.000000  
0.000000 0.000000 0.000000 0.000000  
0.000000 0.000000 -49057123615670591891177472.000000 0.000005  
-0.000000 0.000000 -344859.468750 0.000000  
0.000000 0.000000 0.000000 0.000000  
0.000000 0.000000 -49057123615670591891177472.000000 0.000005  
-0.000000 0.000000 -702221.000000 0.000000  
-6630776053649813224172895258552565760.000000 0.000000 -702323.312500 0.000000  
-1446412.000000 0.000000 0.000000 0.000000  
-0.000000 0.000000 -702231.437500 0.000000  
-0.000000 0.000000 -0.000000 0.000000  
-1446958.000000 0.000000 -0.000000 0.000000  
-0.000000 0.000000 -427953.250000 0.000000  
-0.000000 0.000000 -307492.281250 0.000000  
0.000000 0.000000 0.000000 0.000000  
-0.000000 0.000000 -0.000000 0.000000  
0.000000 0.000000 -0.000000 0.000000  
-1172276.000000 0.000000 0.000000 0.000000  
-0.000000 0.000000 -0.000000 0.000000

Please help,

Thanks Sabalaba,  
–Binh Pham

---

<div class="post-metadata">

**Author:** ![sabalaba](https://sea1.discourse-cdn.com/flex019/user_avatar/deeptalk.lambda.ai/sabalaba/32/4_2.png) [@sabalaba](https://deeptalk.lambda.ai/u/sabalaba)\
**Post date:** [October 4, 2018, 1:53am UTC](https://deeptalk.lambda.ai/t/cuda-no-longer-work-when-installing-new-ubuntu-update/520/4 "2018-10-04T01:53:11Z")

</div>

What is the expected output? What did you used to get on the old version? Seems odd that it would be different.
