Skip to content

Instantly share code, notes, and snippets.

@akors
akors / CMakeLists.txt
Created December 14, 2017 15:02
CUDA device linking with shared objects - cudart vs cudart_static
cmake_minimum_required(VERSION 3.7)
project (CudaSharedThrust CXX CUDA)
string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_61,code=compute_61")
if(BUILD_SHARED_LIBS)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
#include <thrust/device_vector.h>
#include <thrust/transform.h>
// commmand line:
// nvcc --std=c++11 -c nvcc-cpp11-crash.cu nvcc-cpp11-crash.cu.o
//
// crashes nvcc with:
// Error: Internal Compiler Error (codegen): "there was an error in verifying the lgenfe output!"
// GCC 6.4, CUDA (9.0.176)
@akors
akors / conv3dnet.py
Created August 10, 2016 10:15
Example of 3D convolutional network with TensorFlow
import tensorflow as tf
import numpy as np
FC_SIZE = 1024
DTYPE = tf.float32
def _weight_variable(name, shape):
return tf.get_variable(name, shape, DTYPE, tf.truncated_normal_initializer(stddev=0.1))
@akors
akors / gpu-usage_fast.txt
Created July 27, 2016 09:14
GPU Usage before and after Slowdown
timestamp, utilization.gpu [%], utilization.memory [%], temperature.gpu
2016/07/27 11:12:44.220, 100, 68, 65
2016/07/27 11:12:44.720, 97, 69, 66
2016/07/27 11:12:45.221, 88, 69, 65
2016/07/27 11:12:45.721, 65, 50, 64
2016/07/27 11:12:46.222, 44, 27, 64
2016/07/27 11:12:46.722, 21, 4, 64
2016/07/27 11:12:47.223, 8, 0, 64
2016/07/27 11:12:47.723, 0, 0, 63
2016/07/27 11:12:48.223, 16, 2, 64
@akors
akors / cudalibs-gtx1080.txt
Last active July 26, 2016 15:00
Output of `ls -l /usr/local/cuda/lib64` on the Machine with the GTX 960 and GTX 1080
total 867688
-rw-r--r-- 1 root root 28585480 Jul 20 17:48 libcublas_device.a
lrwxrwxrwx 1 root root 16 Jul 20 17:48 libcublas.so -> libcublas.so.7.5
lrwxrwxrwx 1 root root 19 Jul 20 17:48 libcublas.so.7.5 -> libcublas.so.7.5.18
-rwxr-xr-x 1 root root 23938736 Jul 20 17:48 libcublas.so.7.5.18
-rw-r--r-- 1 root root 28220076 Jul 20 17:48 libcublas_static.a
-rw-r--r-- 1 root root 322936 Jul 20 17:48 libcudadevrt.a
lrwxrwxrwx 1 root root 16 Jul 20 17:47 libcudart.so -> libcudart.so.7.5
lrwxrwxrwx 1 root root 19 Jul 20 17:48 libcudart.so.7.5 -> libcudart.so.7.5.18
-rwxr-xr-x 1 root root 383336 Jul 20 17:48 libcudart.so.7.5.18
diff --git a/src/test/java/com/google/devtools/build/lib/MOCK_CROSSTOOL b/src/test/java/com/google/devtools/build/lib/MOCK_CROSSTOOL
index 323c359..4e6a264 100644
--- a/src/test/java/com/google/devtools/build/lib/MOCK_CROSSTOOL
+++ b/src/test/java/com/google/devtools/build/lib/MOCK_CROSSTOOL
@@ -36,10 +36,10 @@ toolchain {
tool_path { name: "ar" path: "/usr/bin/ar" }
tool_path { name: "compat-ld" path: "/usr/bin/ld" }
- tool_path { name: "cpp" path: "/usr/bin/cpp" }
+ tool_path { name: "cpp" path: "/opt/gcc-4.9/bin/cpp" }
[alexander@desktop-fedora bazel]$ echo $PATH
/usr/lib/ccache:/usr/lib/ccache:/usr/lib64/qt-3.3/bin:/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/alexander/.local/bin:/home/alexander/bin:/home/alexander/.local/bin:/home/alexander/bin
[alexander@desktop-fedora bazel]$ echo $LD_LIBRARY_PATH+
:/usr/local/cuda/lib64:/usr/local/cuda/lib64+
[alexander@desktop-fedora bazel]$ ./compile.sh
INFO: You can skip this first step by providing a path to the bazel binary as second argument:
INFO: ./compile.sh compile /path/to/bazel
🍃 Building Bazel from scratch......
🍃 Building Bazel with Bazel.
WARNING: /home/alexander/source/bazel/src/main/native/BUILD:46:16: in includes attribute of cc_binary rule //src/main/native:libunix.so: '.' resolves to 'src/main/native' not in 'third_party'. This will be an error in the future.